mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Geometry: Fix profile copy/paste.
This commit is contained in:
1 parent
2a1c8c1e57
commit
f4d3f2b28f
6 files changed
+50
-13
No files matched your search
@@ -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
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -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
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
@@ -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
|
||||
)
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user