]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Text transformation bug fix: Horizontal alignment was applied twice, and scale was...
authorjplaine <jplaine@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 14 Dec 2010 10:55:39 +0000 (10:55 +0000)
committerjplaine <jplaine@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 14 Dec 2010 10:55:39 +0000 (10:55 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@19145 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/HoverTextNode.java

index 7d29ffcf46dc235d09778bcd9f1739e488686737..f3d3e0d775e0128a0ffed86b1a77b5f7b7bf3ee7 100644 (file)
@@ -41,12 +41,6 @@ public class HoverTextNode extends TextNode implements ISelectionPainterNode {
         AffineTransform ot = g.getTransform();\r
         g.transform(transform);\r
 \r
-        if (horizontalAlignment == Alignment.CENTER.ordinal()) {\r
-            // FIXME: Font.getStringBounds is expensive. Optimize so that it is only executed when the text changes.\r
-            Rectangle2D stringBounds = font.getStringBounds(text, g.getFontRenderContext());\r
-            g.translate(- stringBounds.getWidth() / 2 * scale, 0);\r
-        }\r
-\r
         boolean selected = NodeUtil.isSelected(this, 1);\r
         if (!selected && hover){\r
             BasicStroke oldStroke = (BasicStroke)g.getStroke();\r