import java.awt.BasicStroke;\r
import java.awt.Color;\r
import java.awt.Graphics2D;\r
+import java.awt.geom.AffineTransform;\r
import java.awt.geom.Rectangle2D;\r
\r
import org.simantics.diagram.elements.TextNode;\r
if (text == null || font == null || color == null)\r
return;\r
\r
+ AffineTransform ot = g.getTransform();\r
g.transform(transform);\r
\r
if (horizontalAlignment == Alignment.CENTER.ordinal()) {\r
}\r
\r
super.render(g, false);\r
+ g.setTransform(ot);\r
}\r
\r
}\r
import java.awt.BasicStroke;\r
import java.awt.Color;\r
import java.awt.Graphics2D;\r
+import java.awt.geom.AffineTransform;\r
import java.awt.geom.Rectangle2D;\r
import org.simantics.scenegraph.g2d.G2DNode;\r
\r
@Override\r
public void render(Graphics2D g) {\r
if(bounds == null) return;\r
+ AffineTransform ot = g.getTransform();\r
+ \r
g.transform(transform);\r
g.setColor(Color.BLACK);\r
double scale = g.getTransform().getScaleX();\r
g.setStroke(new BasicStroke( (float)(1.0 / scale) ));\r
\r
g.draw(bounds);\r
+ g.setTransform(ot);\r
}\r
\r
@Override\r