|
From: <md...@us...> - 2010-08-16 19:57:31
|
Revision: 8637
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8637&view=rev
Author: mdboom
Date: 2010-08-16 19:57:25 +0000 (Mon, 16 Aug 2010)
Log Message:
-----------
Merged revisions 8636 via svnmerge from
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v1_0_maint
........
r8636 | mdboom | 2010-08-16 15:56:27 -0400 (Mon, 16 Aug 2010) | 4 lines
Add explicit "CLOSEPOLY" codes to unit_rectangle, unit_polygon,
unit_star and unit_asterisk. Not doing so causes the strokes to have
the wrong end cap at the beginning/end point.
........
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/path.py
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Modified: svnmerge-integrated
- /branches/mathtex:1-7263 /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-7253 /branches/v1_0_maint:1-8634 /trunk/matplotlib:1-7315
+ /branches/mathtex:1-7263 /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-7253 /branches/v1_0_maint:1-8636 /trunk/matplotlib:1-7315
Modified: trunk/matplotlib/lib/matplotlib/path.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/path.py 2010-08-16 19:56:27 UTC (rev 8636)
+++ trunk/matplotlib/lib/matplotlib/path.py 2010-08-16 19:57:25 UTC (rev 8637)
@@ -384,7 +384,8 @@
"""
if cls._unit_rectangle is None:
cls._unit_rectangle = \
- cls([[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]])
+ cls([[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]],
+ [cls.MOVETO, cls.LINETO, cls.LINETO, cls.LINETO, cls.CLOSEPOLY])
return cls._unit_rectangle
_unit_regular_polygons = WeakValueDictionary()
@@ -407,8 +408,13 @@
# "points-up"
theta += np.pi / 2.0
verts = np.concatenate((np.cos(theta), np.sin(theta)), 1)
- path = cls(verts)
- cls._unit_regular_polygons[numVertices] = path
+ codes = np.empty((numVertices,))
+ codes[0] = cls.MOVETO
+ codes[1:-1] = cls.LINETO
+ codes[-1] = cls.CLOSEPOLY
+ path = cls(verts, codes)
+ if numVertices <= 16:
+ cls._unit_regular_polygons[numVertices] = path
return path
_unit_regular_stars = WeakValueDictionary()
@@ -433,8 +439,13 @@
r = np.ones(ns2 + 1)
r[1::2] = innerCircle
verts = np.vstack((r*np.cos(theta), r*np.sin(theta))).transpose()
+ codes = np.empty((ns2,))
+ codes[0] = cls.MOVETO
+ codes[1:-1] = cls.LINETO
+ codes[-1] = cls.CLOSEPOLY
path = cls(verts)
- cls._unit_regular_polygons[(numVertices, innerCircle)] = path
+ if numVertices <= 16:
+ cls._unit_regular_polygons[(numVertices, innerCircle)] = path
return path
@classmethod
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|