mirror of https://gitlab.com/pamhyr/pamhyr2
Geometry: Fix move up method.
parent
ba7171326c
commit
a6341dedd2
|
|
@ -243,7 +243,7 @@ class Reach(SQLSubModel):
|
||||||
self.modified()
|
self.modified()
|
||||||
|
|
||||||
def move_up_profile(self, index: int):
|
def move_up_profile(self, index: int):
|
||||||
if index < len(self.profiles):
|
if index < len(self._profiles):
|
||||||
next = index - 1
|
next = index - 1
|
||||||
|
|
||||||
p = self._profiles
|
p = self._profiles
|
||||||
|
|
|
||||||
|
|
@ -168,11 +168,10 @@ class GeometryReachTableModel(PamhyrTableModel):
|
||||||
if row <= 0:
|
if row <= 0:
|
||||||
return
|
return
|
||||||
|
|
||||||
row = self.get_true_data_row(row)
|
target = row + 1
|
||||||
target = row + 2
|
|
||||||
|
|
||||||
self.beginMoveRows(parent, row - 1, row - 1, parent, target)
|
self.beginMoveRows(parent, row - 1, row - 1, parent, target)
|
||||||
|
|
||||||
|
row = self.get_true_data_row(row)
|
||||||
self._undo.push(
|
self._undo.push(
|
||||||
MoveCommand(
|
MoveCommand(
|
||||||
self._data, "up", row
|
self._data, "up", row
|
||||||
|
|
@ -186,11 +185,11 @@ class GeometryReachTableModel(PamhyrTableModel):
|
||||||
if row >= self._data.number_profiles-1:
|
if row >= self._data.number_profiles-1:
|
||||||
return
|
return
|
||||||
|
|
||||||
row = self.get_true_data_row(row)
|
|
||||||
target = row
|
target = row
|
||||||
|
|
||||||
self.beginMoveRows(parent, row + 1, row + 1, parent, target)
|
self.beginMoveRows(parent, row + 1, row + 1, parent, target)
|
||||||
|
|
||||||
|
row = self.get_true_data_row(row)
|
||||||
self._undo.push(
|
self._undo.push(
|
||||||
MoveCommand(
|
MoveCommand(
|
||||||
self._data, "down", row
|
self._data, "down", row
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue