From 854d62356442f70f5bb1b2ac15a6b7365108b6fd Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Sat, 11 Jan 2025 13:46:48 +0100 Subject: fix next element for element_info and jump_to_trim extensions (#3427) --- lib/extensions/element_info.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/extensions/element_info.py') diff --git a/lib/extensions/element_info.py b/lib/extensions/element_info.py index 2f3de736..b84232b7 100644 --- a/lib/extensions/element_info.py +++ b/lib/extensions/element_info.py @@ -28,15 +28,18 @@ class ElementInfo(InkstitchExtension): self.max_stitch_lengths = [] self.min_stitch_lengths = [] + next_elements = [None] + if len(self.elements) > 1: + next_elements = self.elements[1:] + next_elements previous_stitch_group = None - for element in self.elements: - previous_stitch_group = self._element_info(element, previous_stitch_group) + for element, next_element in zip(self.elements, next_elements): + previous_stitch_group = self._element_info(element, previous_stitch_group, next_element) self._general_info() app = ElementInfoApp(self.list_items) app.MainLoop() - def _element_info(self, element, previous_stitch_group): + def _element_info(self, element, previous_stitch_group, next_element): stitch_groups = element.to_stitch_groups(previous_stitch_group) stitch_plan = stitch_groups_to_stitch_plan( stitch_groups, -- cgit v1.2.3