diff options
author | Matthias Becker | 2020-05-20 08:42:13 +0000 |
---|---|---|
committer | Matthias Becker | 2020-05-20 08:42:13 +0000 |
commit | a05a487e16b28b1cbb7ede1b16f7790fd6ed482b (patch) | |
tree | 49fc8c5608f29812f8070a9859a3fbcaa303b58e | |
parent | cbe9fed0f88f2890c7d8f1130daa9e0a7378d882 (diff) | |
download | eclipse.platform.debug-a05a487e16b28b1cbb7ede1b16f7790fd6ed482b.tar.gz eclipse.platform.debug-a05a487e16b28b1cbb7ede1b16f7790fd6ed482b.tar.xz eclipse.platform.debug-a05a487e16b28b1cbb7ede1b16f7790fd6ed482b.zip |
Bug 548430: [Cocoa] NullPointerException in Image.internal_new_GCY20200609-2100Y20200609-0150Y20200528-0030S4_16_0_RC2S4_16_0_RC1S4_16_0_M3R4_16I20200604-0540I20200603-0600I20200602-1800I20200602-0600I20200602-0510I20200602-0010I20200601-1800I20200601-0640I20200601-0140I20200531-1800I20200531-0600I20200530-0600I20200529-0550I20200528-0200I20200528-0000I20200527-1800I20200527-0600I20200526-1800I20200526-0600I20200525-1800I20200525-0640I20200524-1800I20200524-0850I20200524-0600I20200524-0220I20200523-1800I20200523-0600I20200522-1800I20200521-1000I20200520-1800I20200520-0600
- There is an underlying assumption while creating breadcrumb arrows.
The image creation logic assumes the new image created is always created
with transparent color.
Currently only the opaque areas are set with alpha 255, which is opaque.
But the areas where transparency should be set is not handled at all.
This patch sets transparent area with alpha 0, which is transparent.
This change is based on https://git.eclipse.org/r/#/c/163181/
Change-Id: I371373a7d7e1825fb17032465ddbe4e31fb8c0db
-rw-r--r-- | org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDropDown.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDropDown.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDropDown.java index 08739bb78..3f75d9191 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDropDown.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDropDown.java @@ -103,14 +103,24 @@ class BreadcrumbItemDropDown implements IBreadcrumbDropDownSite { image.dispose(); int zoomedArrowSize = ARROW_SIZE * zoom / 100; for (int y1 = 0; y1 < zoomedArrowSize; y1++) { + // set opaque pixels for top half of the breadcrumb arrow for (int x1 = 0; x1 <= y1; x1++) { imageData.setAlpha(fLTR ? x1 : zoomedArrowSize - x1 - 1, y1, 255); } + // set transparent pixels for top half of the breadcrumbe arrow + for (int x1 = y1 + 1; x1 < zoomedArrowSize; x1++) { + imageData.setAlpha(fLTR ? x1 : zoomedArrowSize - x1 - 1, y1, 0); + } } for (int y2 = 0; y2 < zoomedArrowSize; y2++) { + // set opaque pixels for bottom half of the breadcrumb arrow for (int x2 = 0; x2 <= y2; x2++) { imageData.setAlpha(fLTR ? x2 : zoomedArrowSize - x2 - 1, zoomedArrowSize * 2 - y2 - 1, 255); } + // set transparent pixels for bottom half of the breadcrumbe arrow + for (int x2 = y2 + 1; x2 < zoomedArrowSize; x2++) { + imageData.setAlpha(fLTR ? x2 : zoomedArrowSize - x2 - 1, zoomedArrowSize * 2 - y2 - 1, 0); + } } return imageData; }; |