Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 493f425

Browse files
author
Steve Chaplin
committed
SC
svn path=/trunk/matplotlib/; revision=3483
1 parent 3a0c01c commit 493f425

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2007-07-08 Applied Carl Worth's patch to fix cairo draw_arc - SC
2+
13
2007-07-07 fixed bug 1712099: xpdf distiller on windows - DSD
24

35
2007-06-30 Applied patches to tkagg, gtk, and wx backends to reduce

lib/matplotlib/backends/backend_cairo.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,19 +131,16 @@ def _fill_and_stroke (self, ctx, fill_c):
131131
def draw_arc(self, gc, rgbFace, x, y, width, height, angle1, angle2,
132132
rotation):
133133
if _debug: print '%s.%s()' % (self.__class__.__name__, _fn_name())
134-
# this implementation draws circular arcs where width=height
135-
# FIXME
136-
# to get a proper arc of width/height you can use translate() and
137-
# scale(), see cairo_arc() manual page
138-
139134
ctx = gc.ctx
140135
ctx.save()
141-
ctx.new_path() # prevent cairo_arc() adding to current path
136+
ctx.translate(x, self.height - y)
142137
ctx.rotate(rotation)
143-
radius = (height + width) / 4
144-
ctx.arc (x, self.height - y, radius,
145-
angle1 * numx.pi/180.0, angle2 * numx.pi/180.0)
138+
ctx.scale(width / 2.0, height / 2.0)
139+
ctx.new_sub_path()
140+
ctx.arc(0.0, 0.0, 1.0, numx.pi * angle1 / 180.,
141+
numx.pi * angle2 / 180.)
146142
ctx.restore()
143+
147144
self._fill_and_stroke (ctx, rgbFace)
148145

149146

0 commit comments

Comments
 (0)