From bfdbc740110cde7d7986c0e115ed33ab3bb11b1d Mon Sep 17 00:00:00 2001 From: jplaine Date: Tue, 7 Dec 2010 11:25:55 +0000 Subject: [PATCH] Forgot these from the last commit.. git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@18958 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../src/org/simantics/sysdyn/ui/elements2/HoverTextNode.java | 3 +++ .../src/org/simantics/sysdyn/ui/elements2/RectangleNode.java | 4 ++++ 2 files changed, 7 insertions(+) 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 d68d63c2..7d29ffcf 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 @@ -14,6 +14,7 @@ package org.simantics.sysdyn.ui.elements2; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Graphics2D; +import java.awt.geom.AffineTransform; import java.awt.geom.Rectangle2D; import org.simantics.diagram.elements.TextNode; @@ -37,6 +38,7 @@ public class HoverTextNode extends TextNode implements ISelectionPainterNode { if (text == null || font == null || color == null) return; + AffineTransform ot = g.getTransform(); g.transform(transform); if (horizontalAlignment == Alignment.CENTER.ordinal()) { @@ -60,6 +62,7 @@ public class HoverTextNode extends TextNode implements ISelectionPainterNode { } super.render(g, false); + g.setTransform(ot); } } diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/RectangleNode.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/RectangleNode.java index 52566990..8aa983d6 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/RectangleNode.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/RectangleNode.java @@ -14,6 +14,7 @@ package org.simantics.sysdyn.ui.elements2; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Graphics2D; +import java.awt.geom.AffineTransform; import java.awt.geom.Rectangle2D; import org.simantics.scenegraph.g2d.G2DNode; @@ -31,12 +32,15 @@ public class RectangleNode extends G2DNode { @Override public void render(Graphics2D g) { if(bounds == null) return; + AffineTransform ot = g.getTransform(); + g.transform(transform); g.setColor(Color.BLACK); double scale = g.getTransform().getScaleX(); g.setStroke(new BasicStroke( (float)(1.0 / scale) )); g.draw(bounds); + g.setTransform(ot); } @Override -- 2.47.1