View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0017978 | Scribus | Undo/Redo | public | 2026-09-12 17:57 | 2026-09-12 17:59 |
| Reporter | buttar | Assigned To | |||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | new | Resolution | open | ||
| Platform | Linux | OS | Fedora Workstation | OS Version | 44 |
| Product Version | 1.7.4.svn | ||||
| Summary | 0017978: [patch] Node deletion Undo can move the edited object | ||||
| Description | - Undoing deletion of topmost or left-most nodes can restore the path at the wrong position. - Right-most and bottom-most node deletions are generally unaffected. | ||||
| Steps To Reproduce | - Create a shape and enter Edit Shape mode. - Delete a topmost or leftmost node(s). - Press Ctrl+Z. - The node returns, but the object changes position. | ||||
| Additional Information | # Fix - Exclude automatic frame normalisation changes from the node-edit Undo transaction. - Restore paths in the correct local coordinate space. - Preserve item position, contour alignment and image offsets through Undo/Redo. - Restore contour-only edits without recalculating frame geometry. | ||||
| Tags | #please_test | ||||
| Attached Files | nodeedit-undo-position-restoration-v1.01.patch (2,693 bytes)
Index: scribus/pageitem.cpp
===================================================================
--- scribus/pageitem.cpp (revision 27829)
+++ scribus/pageitem.cpp (working copy)
@@ -8008,23 +8008,27 @@
double newX = istate->getDouble("NEW_X");
double newY = istate->getDouble("NEW_Y");
- if (isUndo)
- {
- if (isContour)
- ContourLine = oldClip;
- else
- PoLine = oldClip;
- m_Doc->adjustItemSize(this);
- m_Doc->moveItem(oldX - xPos(), oldY - yPos(), this);
- }
+ const FPointArray& restoredPath = isUndo ? oldClip : newClip;
+ const double restoredX = isUndo ? oldX : newX;
+ const double restoredY = isUndo ? oldY : newY;
+
+ if (isContour)
+ ContourLine = restoredPath;
else
{
- if (isContour)
- ContourLine = newClip;
- else
- PoLine = newClip;
+ QTransform itemTransform = QTransform().rotate(-rotation());
+ QPointF pathDelta = itemTransform.map(QPointF(restoredX, restoredY))
+ - itemTransform.map(QPointF(xPos(), yPos()));
+ PoLine = restoredPath;
+ PoLine.translate(pathDelta.x(), pathDelta.y());
+
+ double xposOrig = xPos();
+ double yposOrig = yPos();
m_Doc->adjustItemSize(this);
- m_Doc->moveItem(newX - xPos(), newY - yPos(), this);
+
+ QPointF contourDelta = itemTransform.map(QPointF(xposOrig, yposOrig))
+ - itemTransform.map(QPointF(xPos(), yPos()));
+ ContourLine.translate(contourDelta.x(), contourDelta.y());
}
if (oldClip.count() != newClip.count())
m_Doc->nodeEdit.deselect();
Index: scribus/canvasmode_nodeedit.cpp
===================================================================
--- scribus/canvasmode_nodeedit.cpp (revision 27829)
+++ scribus/canvasmode_nodeedit.cpp (working copy)
@@ -37,6 +37,7 @@
#include "ui/nodeeditpalette.h"
#include "ui/pageselector.h"
#include "ui/scrspinbox.h"
+#include "undomanager.h"
CanvasMode_NodeEdit::CanvasMode_NodeEdit(ScribusView* view) : CanvasMode(view)
{
@@ -1527,7 +1528,16 @@
double yp = currItem->yPos();
double w = currItem->width();
double h = currItem->height();
+ const bool undoWasEnabled = UndoManager::undoEnabled();
+ if (undoWasEnabled)
+ UndoManager::instance()->setUndoEnabled(false);
m_doc->adjustItemSize(currItem, true);
+ if (undoWasEnabled)
+ UndoManager::instance()->setUndoEnabled(true);
+ QTransform itemTransform = QTransform().rotate(-currItem->rotation());
+ QPointF contourDelta = itemTransform.map(QPointF(xp, yp))
+ - itemTransform.map(QPointF(currItem->xPos(), currItem->yPos()));
+ currItem->ContourLine.translate(contourDelta.x(), contourDelta.y());
double xp2 = currItem->xPos();
double yp2 = currItem->yPos();
double w2 = currItem->width();
| ||||
| Patch | Yes | ||||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2026-09-12 17:57 | buttar | New Issue | |
| 2026-09-12 17:57 | buttar | Tag Attached: #please_test | |
| 2026-09-12 17:57 | buttar | File Added: nodeedit-undo-position-restoration-v1.01.patch | |
| 2026-09-12 17:59 | buttar | Note Added: 0054460 | |
| 2026-09-12 17:59 | buttar | File Added: move-on-undo-issue.mp4 |