From 359eec4bd5e2553dca2a79c023af8635f46a9d92 Mon Sep 17 00:00:00 2001 From: jplaine Date: Tue, 14 Dec 2010 10:55:39 +0000 Subject: [PATCH] Text transformation bug fix: Horizontal alignment was applied twice, and scale was not taken into account in TextNodes horizontal alignment. git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@19145 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../org/simantics/sysdyn/ui/elements2/HoverTextNode.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/HoverTextNode.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/HoverTextNode.java index 7d29ffcf..f3d3e0d7 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/HoverTextNode.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/HoverTextNode.java @@ -41,12 +41,6 @@ public class HoverTextNode extends TextNode implements ISelectionPainterNode { AffineTransform ot = g.getTransform(); g.transform(transform); - if (horizontalAlignment == Alignment.CENTER.ordinal()) { - // FIXME: Font.getStringBounds is expensive. Optimize so that it is only executed when the text changes. - Rectangle2D stringBounds = font.getStringBounds(text, g.getFontRenderContext()); - g.translate(- stringBounds.getWidth() / 2 * scale, 0); - } - boolean selected = NodeUtil.isSelected(this, 1); if (!selected && hover){ BasicStroke oldStroke = (BasicStroke)g.getStroke(); -- 2.47.1