|
From: <md...@us...> - 2010-08-16 19:56:33
|
Revision: 8636
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8636&view=rev
Author: mdboom
Date: 2010-08-16 19:56:27 +0000 (Mon, 16 Aug 2010)
Log Message:
-----------
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:
--------------
branches/v1_0_maint/lib/matplotlib/path.py
Modified: branches/v1_0_maint/lib/matplotlib/path.py
===================================================================
--- branches/v1_0_maint/lib/matplotlib/path.py 2010-08-16 15:06:58 UTC (rev 8635)
+++ branches/v1_0_maint/lib/matplotlib/path.py 2010-08-16 19:56:27 UTC (rev 8636)
@@ -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.
|
|
From: <md...@us...> - 2010-08-16 19:58:25
|
Revision: 8638
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8638&view=rev
Author: mdboom
Date: 2010-08-16 19:58:19 +0000 (Mon, 16 Aug 2010)
Log Message:
-----------
Missed detail in last commit.
Modified Paths:
--------------
branches/v1_0_maint/lib/matplotlib/path.py
Modified: branches/v1_0_maint/lib/matplotlib/path.py
===================================================================
--- branches/v1_0_maint/lib/matplotlib/path.py 2010-08-16 19:57:25 UTC (rev 8637)
+++ branches/v1_0_maint/lib/matplotlib/path.py 2010-08-16 19:58:19 UTC (rev 8638)
@@ -443,7 +443,7 @@
codes[0] = cls.MOVETO
codes[1:-1] = cls.LINETO
codes[-1] = cls.CLOSEPOLY
- path = cls(verts)
+ path = cls(verts, codes)
if numVertices <= 16:
cls._unit_regular_polygons[(numVertices, innerCircle)] = path
return path
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2010-08-17 13:05:02
|
Revision: 8640
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8640&view=rev
Author: mdboom
Date: 2010-08-17 13:04:56 +0000 (Tue, 17 Aug 2010)
Log Message:
-----------
Fix failing test_simplification:test_hatch test.
Modified Paths:
--------------
branches/v1_0_maint/lib/matplotlib/path.py
Modified: branches/v1_0_maint/lib/matplotlib/path.py
===================================================================
--- branches/v1_0_maint/lib/matplotlib/path.py 2010-08-16 19:59:07 UTC (rev 8639)
+++ branches/v1_0_maint/lib/matplotlib/path.py 2010-08-17 13:04:56 UTC (rev 8640)
@@ -439,7 +439,7 @@
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 = np.empty((ns2 + 1,))
codes[0] = cls.MOVETO
codes[1:-1] = cls.LINETO
codes[-1] = cls.CLOSEPOLY
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2010-08-18 16:07:43
|
Revision: 8647
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8647&view=rev
Author: mdboom
Date: 2010-08-18 16:07:37 +0000 (Wed, 18 Aug 2010)
Log Message:
-----------
Fix bug in regular polygon handling
Modified Paths:
--------------
branches/v1_0_maint/lib/matplotlib/path.py
Modified: branches/v1_0_maint/lib/matplotlib/path.py
===================================================================
--- branches/v1_0_maint/lib/matplotlib/path.py 2010-08-17 18:16:21 UTC (rev 8646)
+++ branches/v1_0_maint/lib/matplotlib/path.py 2010-08-18 16:07:37 UTC (rev 8647)
@@ -408,7 +408,7 @@
# "points-up"
theta += np.pi / 2.0
verts = np.concatenate((np.cos(theta), np.sin(theta)), 1)
- codes = np.empty((numVertices,))
+ codes = np.empty((numVertices + 1,))
codes[0] = cls.MOVETO
codes[1:-1] = cls.LINETO
codes[-1] = cls.CLOSEPOLY
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|