Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTill Brychcy2016-10-18 15:50:21 -0400
committerDani Megert2018-03-13 12:20:20 -0400
commitbb666d8b3569e888e6ba3e767a1352ef81cec3db (patch)
treeeaeb7f371f571e7e49368b5159eefc588ddd07fa /org.eclipse.jface.text/src
parenta1f55e784a36ce4c3936367bed46af7c2422ea78 (diff)
downloadeclipse.platform.text-bb666d8b3569e888e6ba3e767a1352ef81cec3db.tar.gz
eclipse.platform.text-bb666d8b3569e888e6ba3e767a1352ef81cec3db.tar.xz
eclipse.platform.text-bb666d8b3569e888e6ba3e767a1352ef81cec3db.zip
Bug 506166 - Print Margin painted at the wrong position on Retina MacI20180315-2000I20180314-2000I20180313-2000
with Font Monaco 11 Change-Id: Id17009c1a47e010b02b0298c48d835ea8aed076d Signed-off-by: Till Brychcy <register.eclipse@brychcy.de>
Diffstat (limited to 'org.eclipse.jface.text/src')
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/MarginPainter.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/MarginPainter.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/MarginPainter.java
index ad666cbc0..6c7f5dbf2 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/MarginPainter.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/MarginPainter.java
@@ -115,10 +115,10 @@ public class MarginPainter implements IPainter, PaintListener {
private void computeWidgetX() {
GC gc= new GC(fTextWidget);
fFontForCachedWidgetX= fTextWidget.getFont();
- int pixels= gc.getFontMetrics().getAverageCharWidth();
+ double pixels= gc.getFontMetrics().getAverageCharacterWidth();
gc.dispose();
- fCachedWidgetX= pixels * fMarginWidth;
+ fCachedWidgetX= (int) (pixels * fMarginWidth + 0.5);
}
@Override

Back to the top