From: jplaine Date: Tue, 14 Dec 2010 10:55:39 +0000 (+0000) Subject: Text transformation bug fix: Horizontal alignment was applied twice, and scale was... X-Git-Tag: 2011-04-05-db-merge-trunk~53 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=359eec4bd5e2553dca2a79c023af8635f46a9d92;p=simantics%2Fsysdyn.git 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 --- 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();