aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Thoms2018-06-13 10:10:09 -0400
committerKarsten Thoms2018-06-18 04:34:49 -0400
commitd868122644e5c227a2f2ac9579634ace561ad8a1 (patch)
treed1b90005bf685176cdbb38c0200ee2da57ed88dc
parent9d72f98f58e0c5fff145461e9a8282f2f6f6c926 (diff)
downloadeclipse.platform.text-d868122644e5c227a2f2ac9579634ace561ad8a1.tar.gz
eclipse.platform.text-d868122644e5c227a2f2ac9579634ace561ad8a1.tar.xz
eclipse.platform.text-d868122644e5c227a2f2ac9579634ace561ad8a1.zip
Bug 535865 - Fixed y offset computationI20180621-2000
On macOS the GC returns the font size, not the number of pixels used to display a character. This is different on Windows. Using TextWidget#getLineHeight fixes the issue. Change-Id: I5201b1614af81d3338f97ee957acea04fd31e677 Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationDrawingStrategy.java3
1 files changed, 1 insertions, 2 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 e95f0d52f..07e1c5672 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
@@ -242,10 +242,9 @@ class InlinedAnnotationDrawingStrategy implements IDrawingStrategy {
String s= textWidget.getText(offset, offset);
Point charBounds= gc.stringExtent(s);
int charWidth= charBounds.x;
- int charHeight= charBounds.y;
// When line text has line header annotation, there is a space on the top, adjust the y by using char height
- y+= bounds.height - charHeight;
+ y+= bounds.height - textWidget.getLineHeight();
// Draw the line content annotation
annotation.setLocation(x, y);