Geometry: Fix profile copy/paste.

This commit is contained in:
parouby committed 2025-09-04 16:41:07 +02:00
1 parent 2a1c8c1e57
commit f4d3f2b28f
6 files changed
+50 -13

No files matched your search

+8 -8
View File
@@ -241,7 +241,6 @@ class GeometryProfileTableModel(PamhyrTableModel):
self.layoutChanged.emit()
def reverse(self):
self._undo.push(
ReverseCommand(
self._data
@@ -259,15 +258,16 @@ class GeometryProfileTableModel(PamhyrTableModel):
self.layoutAboutToBeChanged.emit()
points = list(
map(
lambda d: self._data.point_from_data(header, d),
data
)
)
self._undo.push(
PasteCommand(
self._data, row,
list(
map(
lambda d: self._data.point_from_data(header, d),
data
)
)
self._data, row, points
)
)
+2 -2
View File
@@ -294,13 +294,13 @@ class ProfileWindow(PamhyrWindow):
rows = table.selectionModel().selectedRows()
data = []
data.append(["x", "y", "z", "name"])
data.append(["name", "x", "y", "z"])
for row in rows:
point = self._profile.point(row.row())
data.append(
[
point.x, point.y, point.z, point.name
point.name, point.x, point.y, point.z
]
)
+2 -2
View File
@@ -158,7 +158,7 @@ class PasteCommand(QUndoCommand):
self._row = row
self._profiles = list(
map(
lambda p: deepcopy(p),
lambda p: p.copy(),
profiles
)
)
@@ -180,7 +180,7 @@ class DuplicateCommand(QUndoCommand):
self._rows = rows
self._profiles = list(
map(
lambda p: deepcopy(p),
lambda p: p.copy(),
profiles
)
)