mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Geometry: Fix section modification command.
This commit is contained in:
1 parent
a6341dedd2
commit
c58620fdc2
4 files changed
+34
-14
No files matched your search
@@ -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]]
|
||||
)
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user