@@ -325,12 +325,13 @@ def make_compound_path_from_polys(cls, XY):
325
325
326
326
@classmethod
327
327
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
+ """
329
332
# Handle an empty list in args (i.e. no args).
330
333
if not args :
331
334
return Path (np .empty ([0 , 2 ], dtype = np .float32 ))
332
-
333
- # concatenate paths
334
335
vertices = np .concatenate ([x .vertices for x in args ])
335
336
codes = np .empty (len (vertices ), dtype = cls .code_type )
336
337
i = 0
@@ -341,16 +342,10 @@ def make_compound_path(cls, *args):
341
342
else :
342
343
codes [i :i + len (path .codes )] = path .codes
343
344
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 ]
354
349
355
350
return cls (vertices , codes )
356
351
0 commit comments