Revision: 7919
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7919&view=rev
Author:   mdboom
Date:     2009-11-03 15:46:14 +0000 (Tue, 03 Nov 2009)

Log Message:
-----------
[2890979] Close paths correctly in PolyCollection

Modified Paths:
--------------
    branches/v0_99_maint/lib/matplotlib/collections.py
    branches/v0_99_maint/src/_backend_agg.cpp

Modified: branches/v0_99_maint/lib/matplotlib/collections.py
===================================================================
--- branches/v0_99_maint/lib/matplotlib/collections.py  2009-11-03 13:53:57 UTC 
(rev 7918)
+++ branches/v0_99_maint/lib/matplotlib/collections.py  2009-11-03 15:46:14 UTC 
(rev 7919)
@@ -676,14 +676,19 @@
         if closed:
             self._paths = []
             for xy in verts:
-                if np.ma.isMaskedArray(xy):
-                    if len(xy) and (xy[0] != xy[-1]).any():
-                        xy = np.ma.concatenate([xy, [xy[0]]])
+                if len(xy):
+                    if np.ma.isMaskedArray(xy):
+                        xy = np.ma.concatenate([xy, np.zeros((1,2))])
+                    else:
+                        xy = np.asarray(xy)
+                        xy = np.concatenate([xy, np.zeros((1,2))])
+                    codes = np.empty(xy.shape[0], dtype='uint8')
+                    codes[:] = mpath.Path.LINETO
+                    codes[0] = mpath.Path.MOVETO
+                    codes[-1] = mpath.Path.CLOSEPOLY
+                    self._paths.append(mpath.Path(xy, codes))
                 else:
-                    xy = np.asarray(xy)
-                    if len(xy) and (xy[0] != xy[-1]).any():
-                        xy = np.concatenate([xy, [xy[0]]])
-                self._paths.append(mpath.Path(xy))
+                    self._paths.append(mpath.Path(xy))
         else:
             self._paths = [mpath.Path(xy) for xy in verts]
 

Modified: branches/v0_99_maint/src/_backend_agg.cpp
===================================================================
--- branches/v0_99_maint/src/_backend_agg.cpp   2009-11-03 13:53:57 UTC (rev 
7918)
+++ branches/v0_99_maint/src/_backend_agg.cpp   2009-11-03 15:46:14 UTC (rev 
7919)
@@ -164,7 +164,8 @@
 }
 
 GCAgg::GCAgg(double dpi) :
-  dpi(dpi), isaa(true), linewidth(1.0), alpha(1.0),
+  dpi(dpi), isaa(true),
+  cap(agg::butt_cap), join(agg::round_join), linewidth(1.0), alpha(1.0),
   dashOffset(0.0)
 {
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to