]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/nodes/FlagNode.java
Sync git svn branch with SVN repository r33368.
[simantics/platform.git] / bundles / org.simantics.scenegraph / src / org / simantics / scenegraph / g2d / nodes / FlagNode.java
index 2d18495af7cef439b84a477156d885a2544fb591..c62fc84da66af45c2afe503ebe19cebc28cc9c55 100644 (file)
@@ -27,6 +27,7 @@ import java.awt.geom.Rectangle2D;
 import java.util.Arrays;\r
 \r
 import org.simantics.scenegraph.g2d.G2DNode;\r
+import org.simantics.scenegraph.g2d.G2DPDFRenderingHints;\r
 import org.simantics.scenegraph.utils.GeometryUtils;\r
 \r
 public class FlagNode extends G2DNode {\r
@@ -308,6 +309,7 @@ public class FlagNode extends G2DNode {
             lineDist *= gScaleRecip;\r
             double y = startY;\r
             double textAreaWidth = textArea.getWidth() * gScaleRecip;\r
+            boolean isRenderingPdf = g.getRenderingHint(G2DPDFRenderingHints.KEY_PDF_WRITER) != null;\r
 \r
             for (int i = 0; i < flagText.length; ++i) {\r
                 //String line = flagText[i];\r
@@ -339,8 +341,11 @@ public class FlagNode extends G2DNode {
                 if (DEBUG)\r
                     System.out.println(" DRAW: '" + flagText[i] + "' with " + g.getTransform());\r
 \r
-                //textLayout[i].draw(g, (float) x, (float) y);\r
-                g.drawString(flagText[i], (float) x, (float) y);\r
+                // #6459: render as text in PDF and paths on screen\r
+                if (isRenderingPdf)\r
+                    g.drawString(flagText[i], (float) x, (float) y);\r
+                else\r
+                    textLayout[i].draw(g, (float) x, (float) y);\r
 \r
                 y += lineDist;\r
                 y += rect.getHeight();\r