diff options
author | angelozerr | 2018-02-26 18:39:14 +0000 |
---|---|---|
committer | angelozerr | 2018-02-26 20:05:25 +0000 |
commit | 76d45cda6cb07aee10344fff37c86549938cbc2e (patch) | |
tree | 2382a5d0456daf95b6f16572f4b8a04986501a13 | |
parent | bcee8f82e20ee309201c99262f321029606659c6 (diff) | |
download | eclipse.platform.text-76d45cda6cb07aee10344fff37c86549938cbc2e.tar.gz eclipse.platform.text-76d45cda6cb07aee10344fff37c86549938cbc2e.tar.xz eclipse.platform.text-76d45cda6cb07aee10344fff37c86549938cbc2e.zip |
Bug 531692 - [CodeMining] Fix background color of line contentI20180226-2000
annotation with mark occurrences
Change-Id: Ic7bfd0a8c18109b182f2a545719c825edb77eebf
Signed-off-by: angelozerr <angelo.zerr@gmail.com>
-rw-r--r-- | org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationDrawingStrategy.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationDrawingStrategy.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationDrawingStrategy.java index 1bf8b52feb8..501f9d21eda 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationDrawingStrategy.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationDrawingStrategy.java @@ -189,15 +189,19 @@ class InlinedAnnotationDrawingStrategy implements IDrawingStrategy { // Here we need to redraw this first character because GlyphMetrics clip this // character. String s= textWidget.getText(offset, offset); + int charWidth= gc.stringExtent(s).x; + int charX= x + bounds.width - charWidth; + int charY= y; if (style != null) { if (style.background != null) { gc.setBackground(style.background); + gc.fillRectangle(charX, charY, charWidth + 1, bounds.height); } if (style.foreground != null) { gc.setForeground(style.foreground); } } - gc.drawString(s, bounds.x + bounds.width - gc.stringExtent(s).x, bounds.y, true); + gc.drawString(s, charX, charY, true); } } else { textWidget.redrawRange(offset, length, true); |