Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2019-10-11 13:35:38 +0000
committerAlexander Kurtakov2019-10-11 13:35:38 +0000
commitf284207a2380d3208ce8a7505e8a9d4dca0af59a (patch)
treecde97b005a09e10b78a2371b7f516a1d9dcbfbb1
parent85b99c4d4fbfc65f31590c2a53ffcd2f4a060697 (diff)
downloadeclipse.platform.text-I20191012-1800.tar.gz
eclipse.platform.text-I20191012-1800.tar.xz
eclipse.platform.text-I20191012-1800.zip
Move away of deprecated FontMetrics.getAverageCharWidthI20191013-1800I20191012-1800I20191011-1800
Change-Id: Ie134f4898762fcf97a8d477fffb5ec5f89690afd Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--org.eclipse.jface.text.examples/src/org/eclipse/jface/text/examples/sources/inlined/ColorAnnotation.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/org.eclipse.jface.text.examples/src/org/eclipse/jface/text/examples/sources/inlined/ColorAnnotation.java b/org.eclipse.jface.text.examples/src/org/eclipse/jface/text/examples/sources/inlined/ColorAnnotation.java
index 9ff5dbdea..deb7b5eb6 100644
--- a/org.eclipse.jface.text.examples/src/org/eclipse/jface/text/examples/sources/inlined/ColorAnnotation.java
+++ b/org.eclipse.jface.text.examples/src/org/eclipse/jface/text/examples/sources/inlined/ColorAnnotation.java
@@ -1,5 +1,4 @@
-/**s
- * Copyright (c) 2017 Angelo ZERR.
+/** Copyright (c) 2017, 2019 Angelo ZERR and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -119,7 +118,7 @@ public class ColorAnnotation extends LineContentAnnotation {
*/
private static int getSquareWidth(FontMetrics fontMetrics) {
// width = 2 spaces + size width of square
- int width = 2 * fontMetrics.getAverageCharWidth() + getSquareSize(fontMetrics);
+ int width = (int) (2 * fontMetrics.getAverageCharacterWidth() + getSquareSize(fontMetrics));
return width;
}

Back to the top