Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Keller2012-04-18 17:02:00 +0000
committerMarkus Keller2012-04-18 17:02:00 +0000
commit7471537879c56f83c4621f57bb29a96e53743f50 (patch)
tree70d6185d2bac9c2e6998c982844bf841f55841ce
parent266c1b8718ae1ad4a13c26f5cf0f0913250b1855 (diff)
downloadeclipse.platform.text-7471537879c56f83c4621f57bb29a96e53743f50.tar.gz
eclipse.platform.text-7471537879c56f83c4621f57bb29a96e53743f50.tar.xz
eclipse.platform.text-7471537879c56f83c4621f57bb29a96e53743f50.zip
workaround for Bug 377109: Discrepancy between StyledText#getLineHeight() and FontMetrics#getHeight()v20120418-1702
-rw-r--r--org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/SourceViewerInformationControl.java4
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/SourceViewerInformationControl.java4
2 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/SourceViewerInformationControl.java b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/SourceViewerInformationControl.java
index 5683bd14b07..7970a8217a4 100644
--- a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/SourceViewerInformationControl.java
+++ b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/SourceViewerInformationControl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -464,7 +464,7 @@ class SourceViewerInformationControl implements IInformationControl, IInformatio
GC gc= new GC(fText);
gc.setFont(fTextFont);
int width= gc.getFontMetrics().getAverageCharWidth();
- int height = gc.getFontMetrics().getHeight();
+ int height= fText.getLineHeight();
gc.dispose();
return new Point (widthInChars * width, heightInChars * height);
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/SourceViewerInformationControl.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/SourceViewerInformationControl.java
index 5de5b32d4cd..e0dee289f8d 100644
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/SourceViewerInformationControl.java
+++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/SourceViewerInformationControl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -530,7 +530,7 @@ class SourceViewerInformationControl implements IInformationControl, IInformatio
GC gc= new GC(fText);
gc.setFont(fTextFont);
int width= gc.getFontMetrics().getAverageCharWidth();
- int height = gc.getFontMetrics().getHeight();
+ int height= fText.getLineHeight();
gc.dispose();
return new Point (widthInChars * width, heightInChars * height);

Back to the top