From: lehtonen Date: Tue, 1 Jan 2013 21:58:52 +0000 (+0000) Subject: Fixed brekage that occurred in Sysdyn after multiline support modifications were... X-Git-Tag: simantics-1.10.1~85 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=7faed861fb87f6cbec9ef5973a262ced2b5c8353;p=simantics%2Fsysdyn.git Fixed brekage that occurred in Sysdyn after multiline support modifications were made to TextNode. 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 --- diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/HoverTextNode.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/HoverTextNode.java index 76717577..27bf2808 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/HoverTextNode.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/HoverTextNode.java @@ -50,7 +50,7 @@ public class HoverTextNode extends TextNode implements ISelectionPainterNode { g.setStroke(new BasicStroke((float)(2.0f))); g.scale(scale, scale); g.translate(x, y); - g.draw(expandBoundsUnscaled(alignBounds(getTextBounds()))); + g.draw(expandBoundsUnscaled(getTightAlignedBoundsInLocal(tempBounds.get(), g.getFontRenderContext()))); g.translate(-x, -y); g.scale(scaleRecip, scaleRecip); g.setColor(oldColor); diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/ModuleNode.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/ModuleNode.java index 1c1825fc..2e0bb077 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/ModuleNode.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/ModuleNode.java @@ -41,7 +41,7 @@ public class ModuleNode extends HoverTextNode { g.transform(transform); - Rectangle2D bounds = expandBounds( alignBounds( getTightUnalignedBoundsInLocal( tempBounds.get() ) ) ); + Rectangle2D bounds = expandBounds( getTightAlignedBoundsInLocal( tempBounds.get() ) ); Path2D path = new Path2D.Double(); // LEFT TOP diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/MultilineTextNode.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/MultilineTextNode.java index d390f13d..d36bb8b9 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/MultilineTextNode.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements/MultilineTextNode.java @@ -275,22 +275,4 @@ public class MultilineTextNode extends TextNode { } - /** - * Method for altering colors - * @param c - * @param r - * @param g - * @param b - * @return - */ - private Color add(Color c, int r, int g, int b) { - int nr = c.getRed() + r; - int ng = c.getGreen() + g; - int nb = c.getBlue() + b; - if(nr > 255) nr = 255; - if(ng > 255) ng = 255; - if(nb > 255) nb = 255; - return new Color(nr,ng,nb); - } - }