diff options
author | Karsten Thoms | 2018-06-13 14:10:09 +0000 |
---|---|---|
committer | Karsten Thoms | 2018-06-18 08:34:49 +0000 |
commit | d868122644e5c227a2f2ac9579634ace561ad8a1 (patch) | |
tree | d1b90005bf685176cdbb38c0200ee2da57ed88dc /org.eclipse.jface.text/src | |
parent | 9d72f98f58e0c5fff145461e9a8282f2f6f6c926 (diff) | |
download | eclipse.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>
Diffstat (limited to 'org.eclipse.jface.text/src')
-rw-r--r-- | org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationDrawingStrategy.java | 3 |
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 e95f0d52f96..07e1c567211 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); |