mirror of https://gitlab.com/pamhyr/pamhyr2
Geometry: Section: Fix paste row position.
parent
a30bf8e364
commit
78b4269a69
|
|
@ -212,17 +212,28 @@ class GeometryReachTableModel(PamhyrTableModel):
|
|||
self.layoutChanged.emit()
|
||||
|
||||
def paste(self, row, header, data):
|
||||
if row > self._data.number_profiles:
|
||||
if row > len(self._data._profiles):
|
||||
return
|
||||
|
||||
if len(data) == 0:
|
||||
return
|
||||
|
||||
profile = self._data.profile(row)
|
||||
true_row = next(
|
||||
map(
|
||||
lambda e: e[0],
|
||||
filter(
|
||||
lambda e: e[1] == profile,
|
||||
enumerate(self._data._profiles)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
self.layoutAboutToBeChanged.emit()
|
||||
|
||||
self._undo.push(
|
||||
PasteCommand(
|
||||
self._data, row,
|
||||
self._data, true_row,
|
||||
list(
|
||||
map(
|
||||
lambda d: ProfileXYZ.from_data(header, d),
|
||||
|
|
|
|||
Loading…
Reference in New Issue