[Path] cap_extensions=None should mean [0, 0] when using custom extensions

This commit is contained in:
jan 2026-03-08 22:41:11 -07:00
commit 9a76ce5b66

View file

@ -88,10 +88,10 @@ class Path(Shape):
def cap(self, val: PathCap) -> None:
self._cap = PathCap(val)
if self.cap != PathCap.SquareCustom:
self.cap_extensions = None
elif self.cap_extensions is None:
self._cap_extensions = None
elif self._cap_extensions is None:
# just got set to SquareCustom
self.cap_extensions = numpy.zeros(2)
self._cap_extensions = numpy.zeros(2)
# cap_extensions property
@property
@ -218,9 +218,12 @@ class Path(Shape):
self.vertices = vertices
self.repetition = repetition
self.annotations = annotations
self._cap = cap
if cap == PathCap.SquareCustom and cap_extensions is None:
self._cap_extensions = numpy.zeros(2)
else:
self.cap_extensions = cap_extensions
self.width = width
self.cap = cap
self.cap_extensions = cap_extensions
if rotation:
self.rotate(rotation)
if numpy.any(offset):