@@ -325,12 +325,11 @@ 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+ """Make a compound path from a list of Path objects. Blindly removes
329+ all Path.STOP control points."""
329330 # Handle an empty list in args (i.e. no args).
330331 if not args :
331332 return Path (np .empty ([0 , 2 ], dtype = np .float32 ))
332-
333- # concatenate paths
334333 vertices = np .concatenate ([x .vertices for x in args ])
335334 codes = np .empty (len (vertices ), dtype = cls .code_type )
336335 i = 0
@@ -341,16 +340,10 @@ def make_compound_path(cls, *args):
341340 else :
342341 codes [i :i + len (path .codes )] = path .codes
343342 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 )
343+ # remove STOP's, since internal STOPs are a bug
344+ not_stop_mask = codes != cls .STOP
345+ vertices = vertices [not_stop_mask , :]
346+ codes = codes [not_stop_mask ]
354347
355348 return cls (vertices , codes )
356349
0 commit comments