Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMickael Istria2019-07-03 07:28:42 +0000
committerMickael Istria2019-07-03 07:28:51 +0000
commit9751a936275afaf5ae7791a8cd415e2723339289 (patch)
treeb6922d20f9b293fadd9f88e801237729317b7a13
parentb1a591a215a78b2df6199130bf0512e2e1ae6998 (diff)
downloadeclipse.platform.text-9751a936275afaf5ae7791a8cd415e2723339289.tar.gz
eclipse.platform.text-9751a936275afaf5ae7791a8cd415e2723339289.tar.xz
eclipse.platform.text-9751a936275afaf5ae7791a8cd415e2723339289.zip
Bug 547519 - Workaround bug 548866I20190703-0640
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.java3
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);

Back to the top