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

Skip to content

Commit 35f724f

Browse files
author
Steve Chaplin
committed
'SC'
svn path=/trunk/matplotlib/; revision=1562
1 parent ae0031d commit 35f724f

2 files changed

Lines changed: 10 additions & 15 deletions

File tree

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
New entries should be added at the top
22

3+
2005-07-25 backend_svg.py: simplify code by deleting GraphicsContextSVG and
4+
RendererSVG.new_gc(), and moving the gc.get_capstyle() code into
5+
RendererSVG._get_gc_props_svg() - SC
6+
37
2005-07-24 backend_gtk.py: call FigureCanvasBase.motion_notify_event() on
48
all motion-notify-events, not just ones where a modifier key or
59
button has been pressed (fixes bug report from Niklas Volbers) - SC

lib/matplotlib/backends/backend_svg.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,14 @@ def _get_font(self, prop):
6868
font.set_size(size, 72.0)
6969
return font
7070

71+
7172
def _get_gc_props_svg(self, gc):
7273
color='stroke: %s; ' % rgb2hex(gc.get_rgb())
7374
linewidth = 'stroke-width: %f; ' % gc.get_linewidth()
74-
join = 'stroke-linejoin: %s; ' % gc.get_joinstyle()
75-
cap = 'stroke-linecap: %s; ' % gc.get_capstyle()
75+
join = 'stroke-linejoin: %s; ' % gc.get_joinstyle()
76+
cap = 'stroke-linecap: %s; ' % {'projecting' : 'square',
77+
'butt' : 'butt',
78+
'round': 'round',}[gc.get_capstyle()]
7679
alpha = 'opacity: %f; '% gc.get_alpha()
7780
offset, seq = gc.get_dashes()
7881
if seq is not None:
@@ -82,6 +85,7 @@ def _get_gc_props_svg(self, gc):
8285
dashes = ''
8386
return '%(color)s %(linewidth)s %(join)s %(cap)s %(dashes)s %(alpha)s'%locals()
8487

88+
8589
def _get_gc_clip_svg(self, gc):
8690
cliprect = gc.get_clip_rectangle()
8791
if cliprect is not None:
@@ -240,20 +244,7 @@ def get_text_width_height(self, s, prop, ismath):
240244
h /= 64.0
241245
return w, h
242246

243-
def new_gc(self):
244-
return GraphicsContextSVG()
245-
246247

247-
class GraphicsContextSVG(GraphicsContextBase):
248-
def get_capstyle(self):
249-
'one of butt/round/square/none'
250-
d = {'projecting' : 'square',
251-
'butt' : 'butt',
252-
'round' : 'round',
253-
}
254-
return d[self._capstyle.lower()]
255-
256-
257248
class FigureCanvasSVG(FigureCanvasBase):
258249

259250
def print_figure(self, filename, dpi=80,

0 commit comments

Comments
 (0)