From 9a76ce5b66d14e3f536fff4e79faa3a20f4b166c Mon Sep 17 00:00:00 2001 From: jan Date: Sun, 8 Mar 2026 22:41:11 -0700 Subject: [PATCH] [Path] cap_extensions=None should mean [0, 0] when using custom extensions --- masque/shapes/path.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/masque/shapes/path.py b/masque/shapes/path.py index 9c31561..d4c7b24 100644 --- a/masque/shapes/path.py +++ b/masque/shapes/path.py @@ -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):