diff options
author | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-10-26 17:21:58 -0400 |
---|---|---|
committer | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-10-26 17:21:58 -0400 |
commit | 7a336975c60c1d054f5553c0be260449fea9c75a (patch) | |
tree | 2711c3698f29d3fbaa88f6dca5118c7430ed0dea /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java | |
parent | 8768b4b57ea3e0d4a81ed87d1ceddaec1f0f3d74 (diff) | |
download | eclipse.platform.swt-7a336975c60c1d054f5553c0be260449fea9c75a.tar.gz eclipse.platform.swt-7a336975c60c1d054f5553c0be260449fea9c75a.tar.xz eclipse.platform.swt-7a336975c60c1d054f5553c0be260449fea9c75a.zip |
fix other places with polygon regions
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java index 04d595bbee..eb9d33d7ba 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java @@ -455,21 +455,9 @@ long /*int*/ convertRgn(long /*int*/ rgn, double[] matrix) { pointArray[6] = (int)x[0]; pointArray[7] = (int)Math.round(y[0]); if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) { - int count = pointArray.length / 2; - if (count != 0) { - long /*int*/ cairo = OS.gdk_cairo_create(newRgn); - Cairo.cairo_move_to(cairo, pointArray[0], pointArray[1]); - for (int n=1,j=2; n<count; n++,j+=2) { - Cairo.cairo_move_to(cairo, pointArray[j]+0.5, pointArray[j+1]+0.5); - } - Cairo.cairo_close_path(cairo); - Cairo.cairo_set_fill_rule(cairo, Cairo.CAIRO_FILL_RULE_EVEN_ODD); - Cairo.cairo_fill(cairo); - long /*int*/ surface = Cairo.cairo_get_target(cairo); - long /*int*/ polyRgn = OS.gdk_cairo_region_create_from_surface(surface); - Cairo.cairo_region_union(newRgn, polyRgn); - Cairo.cairo_destroy(cairo); - } + long /*int*/ polyRgn = Region.cairoPolygonRgn(pointArray); + Cairo.cairo_region_union(newRgn, polyRgn); + Cairo.cairo_region_destroy(polyRgn); } else { long /*int*/ polyRgn = OS.gdk_region_polygon(pointArray, pointArray.length / 2, OS.GDK_EVEN_ODD_RULE); OS.gdk_region_union(newRgn, polyRgn); |