diff options
author | Mickael Istria | 2019-07-03 07:28:42 +0000 |
---|---|---|
committer | Mickael Istria | 2019-07-03 07:28:51 +0000 |
commit | 9751a936275afaf5ae7791a8cd415e2723339289 (patch) | |
tree | b6922d20f9b293fadd9f88e801237729317b7a13 | |
parent | b1a591a215a78b2df6199130bf0512e2e1ae6998 (diff) | |
download | eclipse.platform.text-9751a936275afaf5ae7791a8cd415e2723339289.tar.gz eclipse.platform.text-9751a936275afaf5ae7791a8cd415e2723339289.tar.xz eclipse.platform.text-9751a936275afaf5ae7791a8cd415e2723339289.zip |
Change-Id: I9446a114f469993f18c30d6d3ea01500ba00747f
Signed-off-by: Mickael Istria <mistria@redhat.com>
-rw-r--r-- | org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationDrawingStrategy.java | 3 |
1 files changed, 2 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 ec8451dbafb..ed569af78c2 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 @@ -249,7 +249,8 @@ class InlinedAnnotationDrawingStrategy implements IDrawingStrategy { } if (gc != null) { char hostCharacter= textWidget.getText(widgetOffset - 1, widgetOffset - 1).charAt(0); - int redrawnCharacterWidth= hostCharacter != '\t' ? gc.getCharWidth(hostCharacter) : textWidget.getTabs() * gc.getCharWidth(' '); + // use gc.stringExtent instead of gc.geCharWidth because of bug 548866 + int redrawnCharacterWidth= hostCharacter != '\t' ? gc.stringExtent(Character.toString(hostCharacter)).x : textWidget.getTabs() * gc.stringExtent(" ").x; //$NON-NLS-1$ Rectangle charBounds= textWidget.getTextBounds(widgetOffset - 1, widgetOffset - 1); Rectangle annotationBounds= new Rectangle(charBounds.x + redrawnCharacterWidth, charBounds.y, annotation.getWidth(), charBounds.height); |