]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Fixed brekage that occurred in Sysdyn after multiline support modifications were...
authorlehtonen <lehtonen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 1 Jan 2013 21:58:52 +0000 (21:58 +0000)
committerlehtonen <lehtonen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 1 Jan 2013 21:58:52 +0000 (21:58 +0000)
Sysdyn contains scene graph node implementations that are inherited from TextNode and those were broken by r26561.

refs #3924

git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@26563 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/HoverTextNode.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/ModuleNode.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/MultilineTextNode.java

index 76717577f307a3506649395c6a4ef9025b32bdec..27bf28085542f2d48fe92405af984ae151504b0d 100644 (file)
@@ -50,7 +50,7 @@ public class HoverTextNode extends TextNode implements ISelectionPainterNode {
             g.setStroke(new BasicStroke((float)(2.0f)));\r
             g.scale(scale, scale);\r
             g.translate(x, y);\r
-            g.draw(expandBoundsUnscaled(alignBounds(getTextBounds())));\r
+            g.draw(expandBoundsUnscaled(getTightAlignedBoundsInLocal(tempBounds.get(), g.getFontRenderContext())));\r
             g.translate(-x, -y);\r
             g.scale(scaleRecip, scaleRecip);\r
             g.setColor(oldColor);\r
index 1c1825fc5eef7f9afbbb3c06eb2e54c365a02cee..2e0bb077c2b6dc0dc2750c3c3558424f8f7193d8 100644 (file)
@@ -41,7 +41,7 @@ public class ModuleNode extends HoverTextNode {
         \r
         g.transform(transform);\r
        \r
-        Rectangle2D bounds = expandBounds( alignBounds( getTightUnalignedBoundsInLocal( tempBounds.get() ) ) );\r
+        Rectangle2D bounds = expandBounds( getTightAlignedBoundsInLocal( tempBounds.get() ) );\r
 \r
         Path2D path = new Path2D.Double();\r
         // LEFT TOP\r
index d390f13d2453eec748c415268f06c91a62bb29e8..d36bb8b996bce5aeaaca2ae32536907f7cff6f89 100644 (file)
@@ -275,22 +275,4 @@ public class MultilineTextNode extends TextNode {
 \r
     }\r
 \r
-    /**\r
-     * Method for altering colors\r
-     * @param c\r
-     * @param r\r
-     * @param g\r
-     * @param b\r
-     * @return\r
-     */\r
-    private Color add(Color c, int r, int g, int b)  {\r
-        int nr = c.getRed() + r;\r
-        int ng = c.getGreen() + g;\r
-        int nb = c.getBlue() + b;\r
-        if(nr > 255) nr = 255;\r
-        if(ng > 255) ng = 255;\r
-        if(nb > 255) nb = 255;\r
-        return new Color(nr,ng,nb);\r
-    }\r
-    \r
 }\r