Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfea08e8

Browse files
committed
incorporate#16822
1 parent687cd7a commitfea08e8

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

‎lib/matplotlib/path.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -326,22 +326,27 @@ def make_compound_path_from_polys(cls, XY):
326326

327327
@classmethod
328328
defmake_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+
"""
330333
# Handle an empty list in args (i.e. no args).
331334
ifnotargs:
332335
returnPath(np.empty([0,2],dtype=np.float32))
333-
334336
vertices=np.concatenate([x.verticesforxinargs])
335337
codes=np.empty(len(vertices),dtype=cls.code_type)
336338
i=0
337339
forpathinargs:
338-
codes=path.codes
339-
ifcodesisNone:
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+
ifpath.codesisNone:
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
344345
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]
345350

346351
returncls(vertices,codes)
347352

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp