Geometry: Fix section modification command.

This commit is contained in:
parouby committed 2025-09-05 16:57:12 +02:00
1 parent a6341dedd2
commit c58620fdc2
4 files changed
+34 -14

No files matched your search

+6 -6
View File
@@ -239,10 +239,10 @@ class Profile(object):
# Move
def move_up_point(self, index: int):
if index < len(self.points):
if index < len(self._points):
next = index - 1
p = self.points
p = self._points
p[index], p[next] = p[next], p[index]
self.modified()
@@ -250,7 +250,7 @@ class Profile(object):
if index >= 0:
prev = index + 1
p = self.points
p = self._points
p[index], p[prev] = p[prev], p[index]
self.modified()
@@ -265,7 +265,7 @@ class Profile(object):
def predicate(p): return p.z
self._points = sorted(
self.points,
self._points,
key=predicate,
reverse=is_reversed
)
@@ -273,14 +273,14 @@ class Profile(object):
@timer
def sort_with_indexes(self, indexes: list):
if len(self.points) != len(indexes):
if len(self._points) != len(indexes):
logger.critical("Indexes list do not correspond to point list")
self._points = list(
map(
lambda x: x[1],
sorted(
enumerate(self.points),
enumerate(self._points),
key=lambda x: indexes[x[0]]
)
)