Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2018-07-18 16:12:31 +0000
committerAlexander Kurtakov2018-07-18 16:12:31 +0000
commit8f5e34a7b9e0b614db5554cdc0d42a24e4cd9912 (patch)
tree17efdcf05b6a6de38e7a35a0c3cca515aae94e31
parent987f29d0e8c9ef768ad4c357c2ff839ce547944e (diff)
downloadeclipse.platform.text-8f5e34a7b9e0b614db5554cdc0d42a24e4cd9912.tar.gz
eclipse.platform.text-8f5e34a7b9e0b614db5554cdc0d42a24e4cd9912.tar.xz
eclipse.platform.text-8f5e34a7b9e0b614db5554cdc0d42a24e4cd9912.zip
Don't use the deprecated FontMetrics.getAverageCharWidth
There is the new getAverageCharacterWidth which returns double instead of int now. Change-Id: Id0efec3051c2992faddb9c5f172043ea9b353212
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/SourceViewerInformationControl.java6
1 files changed, 3 insertions, 3 deletions
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 eef0739fc87..91563913a7d 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, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 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
@@ -474,10 +474,10 @@ class SourceViewerInformationControl implements IInformationControl, IInformatio
public Point computeSizeConstraints(int widthInChars, int heightInChars) {
GC gc= new GC(fText);
gc.setFont(fTextFont);
- int width= gc.getFontMetrics().getAverageCharWidth();
+ double width= gc.getFontMetrics().getAverageCharacterWidth();
int height= fText.getLineHeight();
gc.dispose();
- return new Point (widthInChars * width, heightInChars * height);
+ return new Point((int) (widthInChars * width), heightInChars * height);
}
}

Back to the top