summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/cairo
diff options
context:
space:
mode:
authorSilenio Quarti <silenio>2005-03-22 16:55:00 +0000
committerSilenio Quarti <silenio>2005-03-22 16:55:00 +0000
commit14e1337dfe841bbefd79048e9bd38f8c4ca20cbe (patch)
tree3c2163bd6106c7f3bd05fc34a2ba5abf57d1973b /bundles/org.eclipse.swt/Eclipse SWT/cairo
parentea58e97ac5ce5b3c8718b16cdc5391fa3f361299 (diff)
downloadeclipse.platform.swt-14e1337dfe841bbefd79048e9bd38f8c4ca20cbe.tar.gz
eclipse.platform.swt-14e1337dfe841bbefd79048e9bd38f8c4ca20cbe.tar.xz
eclipse.platform.swt-14e1337dfe841bbefd79048e9bd38f8c4ca20cbe.zip
87554
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/cairo')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Path.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Path.java b/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Path.java
index 4336d17054..88d83a1a27 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Path.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Path.java
@@ -103,6 +103,18 @@ public void curveTo(float cx1, float cy1, float cx2, float cy2, float x, float y
Cairo.cairo_curve_to(handle, cx1, cy1, cx2, cy2, x, y);
}
+public void getBounds(float[] bounds) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (bounds == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (bounds.length < 4) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ double[] extents = new double[4];
+ Cairo.cairo_extents(handle, extents);
+ bounds[0] = (float)extents[0];
+ bounds[1] = (float)extents[1];
+ bounds[2] = (float)(extents[2] - extents[0]);
+ bounds[3] = (float)(extents[3] - extents[1]);
+}
+
public void getCurrentPoint(float[] point) {
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (point == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);