Skip to content

Commit

Permalink
BoundingBox: fix undo in alignPivotItself
Browse files Browse the repository at this point in the history
Ref: #366
  • Loading branch information
rodlie committed Dec 27, 2024
1 parent a3388f4 commit 210bcb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/core/Boxes/boundingbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -948,11 +948,10 @@ void BoundingBox::alignPivotItself(const Qt::Alignment align,
}
}

startPosTransform();
// TODO: get undo/redo to save last previous state
startPivotTransform();
mTransformAnimator->setPivotFixedTransform(center);
requestGlobalPivotUpdateIfSelected();
finishTransform();
finishPivotTransform();
}

void BoundingBox::moveByAbs(const QPointF &trans) {
Expand Down
4 changes: 2 additions & 2 deletions src/core/canvasselectedboxesactions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -876,8 +876,8 @@ void Canvas::alignSelectedBoxes(const Qt::Alignment align,
break;
}

pushUndoRedoName("align");
for(const auto &box : mSelectedBoxes) {
pushUndoRedoName(pivot == AlignPivot::pivotItself ? "pivot align" : "box align");
for (const auto &box : mSelectedBoxes) {
if (box == skip) { continue; }
switch(pivot) {
case AlignPivot::pivot:
Expand Down

0 comments on commit 210bcb2

Please sign in to comment.