Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Pazderski2019-07-24 10:18:48 -0400
committerPaul Pazderski2019-07-26 12:14:31 -0400
commite3145df862180f7b4ffe6376008b92dca3632947 (patch)
tree25da81d9fa1169543b245a24ec9a97fbcb977718
parente5c4a39c3ccf0136031a414fd78755d0c3807d92 (diff)
downloadeclipse.platform.text-e3145df862180f7b4ffe6376008b92dca3632947.tar.gz
eclipse.platform.text-e3145df862180f7b4ffe6376008b92dca3632947.tar.xz
eclipse.platform.text-e3145df862180f7b4ffe6376008b92dca3632947.zip
Bug 549560 - Improve image creation in DefaultRangeIndicatorI20190728-1800I20190727-1800I20190726-1800
Change-Id: Iaf89dc5da8c03c0fba50599d79438082ca1b933f Signed-off-by: Paul Pazderski <paul-eclipse@ppazderski.de>
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/DefaultRangeIndicator.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/DefaultRangeIndicator.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/DefaultRangeIndicator.java
index f59130919..5f6c70551 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/DefaultRangeIndicator.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/DefaultRangeIndicator.java
@@ -141,11 +141,11 @@ public class DefaultRangeIndicator extends Annotation implements IAnnotationPres
ImageData imageData= new ImageData(width, height, 1, createPalette(display, rangeIndicatorColor));
- for (int y= 0; y < height; y++)
- for (int x= 0; x < width; x++)
- imageData.setPixel(x, y, (x + y) % 2);
+ for (int y= 0, offset= 1; y < height; y++, offset= (offset + 1) % 2)
+ for (int x= offset; x < width; x += 2)
+ imageData.setPixel(x, y, 1);
- imageData.transparentPixel= imageData.palette.getPixel(imageData.getRGBs()[1]);
+ imageData.transparentPixel= 1;
return new Image(display, imageData);

Back to the top