diff options
author | Alexander Kurtakov | 2019-10-11 13:35:38 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2019-10-11 13:35:38 +0000 |
commit | f284207a2380d3208ce8a7505e8a9d4dca0af59a (patch) | |
tree | cde97b005a09e10b78a2371b7f516a1d9dcbfbb1 /org.eclipse.jface.text.examples | |
parent | 85b99c4d4fbfc65f31590c2a53ffcd2f4a060697 (diff) | |
download | eclipse.platform.text-f284207a2380d3208ce8a7505e8a9d4dca0af59a.tar.gz eclipse.platform.text-f284207a2380d3208ce8a7505e8a9d4dca0af59a.tar.xz eclipse.platform.text-f284207a2380d3208ce8a7505e8a9d4dca0af59a.zip |
Move away of deprecated FontMetrics.getAverageCharWidthI20191013-1800I20191012-1800I20191011-1800
Change-Id: Ie134f4898762fcf97a8d477fffb5ec5f89690afd
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'org.eclipse.jface.text.examples')
-rw-r--r-- | org.eclipse.jface.text.examples/src/org/eclipse/jface/text/examples/sources/inlined/ColorAnnotation.java | 5 |
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 9ff5dbdeaf9..deb7b5eb63b 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; } |