File tree 1 file changed +13
-8
lines changed
1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -326,22 +326,27 @@ def make_compound_path_from_polys(cls, XY):
326
326
327
327
@classmethod
328
328
def make_compound_path (cls , * args ):
329
- """Make a compound path from a list of Path objects."""
329
+ """
330
+ Make a compound path from a list of Path objects. Blindly removes all
331
+ Path.STOP control points.
332
+ """
330
333
# Handle an empty list in args (i.e. no args).
331
334
if not args :
332
335
return Path (np .empty ([0 , 2 ], dtype = np .float32 ))
333
-
334
336
vertices = np .concatenate ([x .vertices for x in args ])
335
337
codes = np .empty (len (vertices ), dtype = cls .code_type )
336
338
i = 0
337
339
for path in args :
338
- codes = path .codes
339
- if codes is None :
340
- codes = np .full (len (path .vertices ), Path .LINETO ,
341
- dtype = Path .code_type )
342
- codes [0 ] = Path .MOVETO # so concatenated strokes stay separate
343
- codes [i :i + len (path .codes )] = codes
340
+ if path .codes is None :
341
+ codes [i ] = cls .MOVETO
342
+ codes [i + 1 :i + len (codes )] = cls .LINETO
343
+ else :
344
+ codes [i :i + len (path .codes )] = path .codes
344
345
i += len (path .vertices )
346
+ # remove STOP's, since internal STOPs are a bug
347
+ not_stop_mask = codes != cls .STOP
348
+ vertices = vertices [not_stop_mask , :]
349
+ codes = codes [not_stop_mask ]
345
350
346
351
return cls (vertices , codes )
347
352
You can’t perform that action at this time.
0 commit comments