@@ -325,12 +325,13 @@ def make_compound_path_from_polys(cls, XY):
325325
326326 @classmethod
327327 def make_compound_path (cls , * args ):
328- """Make a compound path from a list of Path objects."""
328+ """
329+ Make a compound path from a list of Path objects. Blindly removes all
330+ Path.STOP control points.
331+ """
329332 # Handle an empty list in args (i.e. no args).
330333 if not args :
331334 return Path (np .empty ([0 , 2 ], dtype = np .float32 ))
332-
333- # concatenate paths
334335 vertices = np .concatenate ([x .vertices for x in args ])
335336 codes = np .empty (len (vertices ), dtype = cls .code_type )
336337 i = 0
@@ -341,16 +342,10 @@ def make_compound_path(cls, *args):
341342 else :
342343 codes [i :i + len (path .codes )] = path .codes
343344 i += len (path .vertices )
344-
345- # remove internal STOP's, replace kinal stop if present
346- last_vert = None
347- if codes .size > 0 and codes [- 1 ] == cls .STOP :
348- last_vert = vertices [- 1 ]
349- vertices = vertices [codes != cls .STOP , :]
350- codes = codes [codes != cls .STOP ]
351- if last_vert is not None :
352- vertices = np .append (vertices , [last_vert ], axis = 0 )
353- codes = np .append (codes , cls .STOP )
345+ # remove STOP's, since internal STOPs are a bug
346+ not_stop_mask = codes != cls .STOP
347+ vertices = vertices [not_stop_mask , :]
348+ codes = codes [not_stop_mask ]
354349
355350 return cls (vertices , codes )
356351
0 commit comments