Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti2005-03-15 17:31:43 +0000
committerSilenio Quarti2005-03-15 17:31:43 +0000
commitdcb5b6438c44256a7129a57371b071347a181363 (patch)
tree3424c7e0c3e237fa9aa7057594f6654271a12e9f /bundles/org.eclipse.swt/Eclipse SWT/cairo/org
parent6645d9b4000c2c6aee24bd14deca467b00b8afbb (diff)
downloadeclipse.platform.swt-dcb5b6438c44256a7129a57371b071347a181363.tar.gz
eclipse.platform.swt-dcb5b6438c44256a7129a57371b071347a181363.tar.xz
eclipse.platform.swt-dcb5b6438c44256a7129a57371b071347a181363.zip
right quadTo
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/cairo/org')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Path.java10
1 files changed, 9 insertions, 1 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 0658d7e0b1..61b03252a0 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
@@ -124,7 +124,15 @@ public void moveTo(float x, float y) {
public void quadTo(float cx, float cy, float x, float y) {
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
- Cairo.cairo_curve_to(handle, cx, cy, cx, cy, x, y);
+ double[] currentX = new double[1], currentY = new double[1];
+ Cairo.cairo_current_point(handle, currentX, currentY);
+ float x0 = (float)currentX[0];
+ float y0 = (float)currentY[0];
+ float cx1 = x0 + 2 * (cx - x0) / 3;
+ float cy1 = y0 + 2 * (cy - y0) / 3;
+ float cx2 = cx1 + (x - x0) / 3;
+ float cy2 = cy1 + (y - y0) / 3;
+ Cairo.cairo_curve_to(handle, cx1, cy1, cx2, cy2, x, y);
}
public void dispose() {

Back to the top