diff options
author | Silenio Quarti <silenio> | 2005-07-08 17:37:55 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2005-07-08 17:37:55 +0000 |
commit | b1dbb178b5008dcde16cb7cda2cdc928e2b7e39d (patch) | |
tree | 83b47989c3773061897a3b836c8a3634e4f33b4f /bundles/org.eclipse.swt/Eclipse SWT/cairo | |
parent | a8f114be734cf55461b8999b4ca14407d0f10da3 (diff) | |
download | eclipse.platform.swt-b1dbb178b5008dcde16cb7cda2cdc928e2b7e39d.tar.gz eclipse.platform.swt-b1dbb178b5008dcde16cb7cda2cdc928e2b7e39d.tar.xz eclipse.platform.swt-b1dbb178b5008dcde16cb7cda2cdc928e2b7e39d.zip |
103187
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/cairo')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Pattern.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Pattern.java b/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Pattern.java index 8cfe85f307..d26fb67169 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Pattern.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Pattern.java @@ -94,6 +94,9 @@ public Pattern(Device device, Image image) { * @see #dispose() */ public Pattern(Device device, float x1, float y1, float x2, float y2, Color color1, Color color2) { + this(device, x1, y1, x2, y2, color1, 0xFF, color2, 0xFF); +} +public Pattern(Device device, float x1, float y1, float x2, float y2, Color color1, int alpha1, Color color2, int alpha2) { if (device == null) device = Device.getDevice(); if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (color1 == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); @@ -104,9 +107,8 @@ public Pattern(Device device, float x1, float y1, float x2, float y2, Color colo device.checkCairo(); handle = Cairo.cairo_pattern_create_linear(x1, y1, x2, y2); if (handle == 0) SWT.error(SWT.ERROR_NO_HANDLES); - //TODO - how about alpha? - GC.setCairoPatternColor(handle, 0, color1); - GC.setCairoPatternColor(handle, 1, color2); + GC.setCairoPatternColor(handle, 0, color1, alpha1); + GC.setCairoPatternColor(handle, 1, color2, alpha2); Cairo.cairo_pattern_set_extend(handle, Cairo.CAIRO_EXTEND_REPEAT); if (device.tracking) device.new_Object(this); } |