Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti2005-07-12 18:33:32 +0000
committerSilenio Quarti2005-07-12 18:33:32 +0000
commitc6c228114d451138e7c36c029315021c8ef8bbe0 (patch)
treef3cf10e399e1693e0b2628b024cd897f6dc3071d /bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse
parent94428251245e28a46b313a06d78a8d3cf3a92cb2 (diff)
downloadeclipse.platform.swt-c6c228114d451138e7c36c029315021c8ef8bbe0.tar.gz
eclipse.platform.swt-c6c228114d451138e7c36c029315021c8ef8bbe0.tar.xz
eclipse.platform.swt-c6c228114d451138e7c36c029315021c8ef8bbe0.zip
102481
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Path.java16
1 files changed, 9 insertions, 7 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 0d4fb66f5f..72016fa22f 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
@@ -102,13 +102,15 @@ public Path (Device device) {
public void addArc(float x, float y, float width, float height, float startAngle, float arcAngle) {
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
move = true;
- Cairo.cairo_save(handle);
- double lineWidth = Cairo.cairo_get_line_width(handle);
- Cairo.cairo_translate(handle, x + width / 2f, y + height / 2f);
- Cairo.cairo_scale(handle, width / 2f, height / 2f);
- Cairo.cairo_set_line_width(handle, lineWidth / (width / 2f));
- Cairo.cairo_arc_negative(handle, 0, 0, 1, -startAngle * (float)Compatibility.PI / 180, -(startAngle + arcAngle) * (float)Compatibility.PI / 180);
- Cairo.cairo_restore(handle);
+ if (width == height) {
+ Cairo.cairo_arc_negative(handle, x + width / 2f, y + height / 2f, width / 2f, -startAngle * (float)Compatibility.PI / 180, -(startAngle + arcAngle) * (float)Compatibility.PI / 180);
+ } else {
+ Cairo.cairo_save(handle);
+ Cairo.cairo_translate(handle, x + width / 2f, y + height / 2f);
+ Cairo.cairo_scale(handle, width / 2f, height / 2f);
+ Cairo.cairo_arc_negative(handle, 0, 0, 1, -startAngle * (float)Compatibility.PI / 180, -(startAngle + arcAngle) * (float)Compatibility.PI / 180);
+ Cairo.cairo_restore(handle);
+ }
}
/**

Back to the top