]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.diagram/scl/Simantics/Diagram/SVGNode.scl
Supply SVG text editor with element measurement context
[simantics/platform.git] / bundles / org.simantics.diagram / scl / Simantics / Diagram / SVGNode.scl
diff --git a/bundles/org.simantics.diagram/scl/Simantics/Diagram/SVGNode.scl b/bundles/org.simantics.diagram/scl/Simantics/Diagram/SVGNode.scl
new file mode 100644 (file)
index 0000000..9c5d43c
--- /dev/null
@@ -0,0 +1,20 @@
+
+type BoundingBox = (Double,Double,Double,Double)
+
+importJava "org.simantics.diagram.elements.SVGMeasurementContext" where
+  data SVGMeasurementContext
+  getBoundingBox :: SVGMeasurementContext -> String -> <Proc> Maybe BoundingBox
+
+getBoundingBoxX :: BoundingBox -> Double
+getBoundingBoxX (x,_,_,_) = x
+
+getBoundingBoxY :: BoundingBox -> Double
+getBoundingBoxY (_,y,_,_) = y
+
+getBoundingBoxW :: BoundingBox -> Double
+getBoundingBoxW (_,_,w,_) = w
+
+getBoundingBoxH :: BoundingBox -> Double
+getBoundingBoxH (_,_,_,h) = h
+
+