>From 68bae15524f0b99bf4cf196b47ca0995094bb2e6 Mon Sep 17 00:00:00 2001
From: Carl Worth <cworth@cworth.org>
Date: Tue, 19 Jun 2007 17:48:05 -0700
Subject: [PATCH] cairo: Fix implementation of draw_arc

---
 backends/backend_cairo.py |   13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/backends/backend_cairo.py b/backends/backend_cairo.py
index f08eafc..019c83d 100644
--- a/backends/backend_cairo.py
+++ b/backends/backend_cairo.py
@@ -133,21 +133,16 @@ class RendererCairo(RendererBase):
     def draw_arc(self, gc, rgbFace, x, y, width, height, angle1, angle2, rotation):
         if _debug: print '%s.%s()' % (self.__class__.__name__, _fn_name())
         # draws circular arcs where width=height
-        # FIXME
-        # to get a proper arc of width/height you can use translate() and
-        # scale(), see draw_arc() manual page
-
-        #radius = (height + width) / 4
+
         ctx = gc.ctx
         ctx.save()
+        ctx.translate(x, self.height - y)
         ctx.rotate(rotation)
         ctx.scale(width / 2.0, height / 2.0)
-        ctx.arc(0.0, 0.0, 1.0, 0.0, 2*numx.pi)
+        ctx.new_sub_path()
+        ctx.arc(0.0, 0.0, 1.0, numx.pi * angle1 / 180., numx.pi * angle2 / 180.)
         ctx.restore()

-        #ctx.new_path()
-        #ctx.arc (x, self.height - y, radius,
-        #         angle1 * numx.pi/180.0, angle2 * numx.pi/180.0)
         self._fill_and_stroke (ctx, rgbFace)


--
1.5.2.2

