View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0012458 | Scribus | Undo/Redo | public | 2014-06-30 16:03 | 2026-08-23 10:54 |
| Reporter | FirasH | Assigned To | |||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | confirmed | Resolution | open | ||
| Platform | x86_64 | OS | openSUSE | OS Version | 13.1 |
| Product Version | 1.5.0svn | ||||
| Target Version | Future Release - Low Priority | ||||
| Summary | 0012458: X-Pos/Y-Pos shown in Action History do not correspond to Properties > X,Y,Z | ||||
| Description | X-Pos/Y-Pos shown in Action History do not correspond to Properties > X,Y,Z. | ||||
| Steps To Reproduce | 0) Create a new document and make sure Windows > Properties/Action History are opened (if you use pt unit is easier to understand the issue 0012457) 1) Insert an item (example: Text Frame) 2) Select the item and Properties > X,Y,Z > change X-Pos/Y-Pos The values saved in Action History do not correspond to the ones shown in Properties > X,Y,Z In my case: X = X-Pos + 100 Y = Y-Pos + 20 | ||||
| Additional Information | Issue present on: Scribus 1.4.5.svn (19295) Scribus 1.5.0.svn (19300) | ||||
| Tags | #please_test | ||||
| Patch | No | ||||
| child of | 0012500 | acknowledged | Metabug: Undo/Redo (1.5.x.svn) |
|
|
Confirmed issue on OSX 10.8.5 1.5svn r19300 |
|
|
The coordinates displayed in properties palette are page relative. The coordinates one must store in undo action are absolute however. Otherwise undoing a moving of an object between two different pages would simply not work. |
|
|
As per MrB on IRC March 4, 2015: "well.. i think we can fix that.. but the bug is GUI related, not functional.. ie data is correct, just not what the user expects" |
|
|
Here is a patch (with a soft refactor) with a report on the same. fix-actionhistory-xy-ruler-offset-v2.2.patch (5,193 bytes)
Index: scribus/scribusdoc.h
===================================================================
--- scribus/scribusdoc.h (revision 27777)
+++ scribus/scribusdoc.h (working copy)
@@ -831,6 +831,16 @@
int unitIndex() const;
double unitRatio() const;
/**
+ * @brief Convert an item's raw internal X/Y position to the
+ * ruler-relative position shown in Properties > X,Y,Z - subtracts
+ * the ruler's zero-point offset, and, in ruler mode, the current
+ * page's own offset too. Call this wherever a position needs to
+ * match what Properties displays, instead of computing the same
+ * offset independently.
+ */
+ double rulerRelativeXPos(double x);
+ double rulerRelativeYPos(double y);
+ /**
* @brief Apply a master page
*/
bool applyMasterPage(const QString& pageName, int pageNumber);
Index: scribus/scribusdoc.cpp
===================================================================
--- scribus/scribusdoc.cpp (revision 27777)
+++ scribus/scribusdoc.cpp (working copy)
@@ -4847,6 +4847,22 @@
return m_docUnitRatio;
}
+double ScribusDoc::rulerRelativeXPos(double x)
+{
+ double result = x - rulerXoffset;
+ if (guidesPrefs().rulerMode && currentPage())
+ result -= currentPage()->xOffset();
+ return result;
+}
+
+double ScribusDoc::rulerRelativeYPos(double y)
+{
+ double result = y - rulerYoffset;
+ if (guidesPrefs().rulerMode && currentPage())
+ result -= currentPage()->yOffset();
+ return result;
+}
+
bool ScribusDoc::applyMasterPage(const QString& pageName, int pageNumber)
{
if (!MasterNames.contains(pageName))
Index: scribus/pageitem.cpp
===================================================================
--- scribus/pageitem.cpp (revision 27777)
+++ scribus/pageitem.cpp (working copy)
@@ -4699,10 +4699,18 @@
QString unitSuffix = unitGetStrFromIndex(m_Doc->unitIndex());
int unitPrecision = unitGetPrecisionFromIndex(m_Doc->unitIndex());
double unitRatio = m_Doc->unitRatio();
- QString oxString = QString::number(oldXpos * unitRatio, 'f', unitPrecision) + " " + unitSuffix;
- QString oyString = QString::number(oldYpos * unitRatio, 'f', unitPrecision) + " " + unitSuffix;
- QString nxString = QString::number(m_xPos * unitRatio, 'f', unitPrecision) + " " + unitSuffix;
- QString nyString = QString::number(m_yPos * unitRatio, 'f', unitPrecision) + " " + unitSuffix;
+
+ // Properties > X,Y,Z displays position relative to the ruler's zero
+ // point (and, in ruler mode, the current page too) - the same
+ // conversion is used here, so the Action History tooltip shows
+ // the values the user actually set there, rather than the item's
+ // raw internal position. Only affects these display strings; the
+ // OLD_XPOS/NEW_XPOS state stored below for undo/redo itself stays
+ // in raw internal coordinates, unchanged.
+ QString oxString = QString::number(m_Doc->rulerRelativeXPos(oldXpos) * unitRatio, 'f', unitPrecision) + " " + unitSuffix;
+ QString oyString = QString::number(m_Doc->rulerRelativeYPos(oldYpos) * unitRatio, 'f', unitPrecision) + " " + unitSuffix;
+ QString nxString = QString::number(m_Doc->rulerRelativeXPos(m_xPos) * unitRatio, 'f', unitPrecision) + " " + unitSuffix;
+ QString nyString = QString::number(m_Doc->rulerRelativeYPos(m_yPos) * unitRatio, 'f', unitPrecision) + " " + unitSuffix;
QString tooltip = QString(Um::MoveFromTo).arg(oxString, oyString, oldp, nxString, nyString, newp);
auto *ss = new SimpleState(Um::Move, tooltip, Um::IMove);
ss->set("ITEM_MOVE");
Index: scribus/ui/propertiespalette_xyz.cpp
===================================================================
--- scribus/ui/propertiespalette_xyz.cpp (revision 27777)
+++ scribus/ui/propertiespalette_xyz.cpp (working copy)
@@ -666,13 +666,8 @@
double inY = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
if (tmp)
{
- inX -= m_doc->rulerXoffset;
- inY -= m_doc->rulerYoffset;
- if (m_doc->guidesPrefs().rulerMode)
- {
- inX -= m_doc->currentPage()->xOffset();
- inY -= m_doc->currentPage()->yOffset();
- }
+ inX = m_doc->rulerRelativeXPos(inX);
+ inY = m_doc->rulerRelativeYPos(inY);
}
xposSpin->setValue(inX * m_unitRatio);
yposSpin->setValue(inY * m_unitRatio);
@@ -1273,13 +1268,8 @@
m_ScMW->view->RCenter = FPoint(inX, inY);
- inX -= m_doc->rulerXoffset;
- inY -= m_doc->rulerYoffset;
- if (m_doc->guidesPrefs().rulerMode)
- {
- inX -= m_doc->currentPage()->xOffset();
- inY -= m_doc->currentPage()->yOffset();
- }
+ inX = m_doc->rulerRelativeXPos(inX);
+ inY = m_doc->rulerRelativeYPos(inY);
xposSpin->setValue(inX*m_unitRatio);
yposSpin->setValue(inY*m_unitRatio);
}
@@ -1326,13 +1316,8 @@
inX = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
inY = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
- inX -= m_doc->rulerXoffset;
- inY -= m_doc->rulerYoffset;
- if (m_doc->guidesPrefs().rulerMode)
- {
- inX -= m_doc->currentPage()->xOffset();
- inY -= m_doc->currentPage()->yOffset();
- }
+ inX = m_doc->rulerRelativeXPos(inX);
+ inY = m_doc->rulerRelativeYPos(inY);
xposSpin->setValue(inX*m_unitRatio);
yposSpin->setValue(inY*m_unitRatio);
}
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2014-06-30 16:03 | FirasH | New Issue | |
| 2014-06-30 16:05 | Kunda | Note Added: 0032373 | |
| 2014-06-30 16:06 | FirasH | Status | new => confirmed |
| 2014-06-30 16:53 | jghali | Note Added: 0032378 | |
| 2014-06-30 16:56 | jghali | Note Edited: 0032378 | |
| 2014-07-01 14:36 | FirasH | Summary | Action History records wrong X-Pos/Y-Pos => X-Pos/Y-Pos shown in Action History do not correspond to Properties > X,Y,Z |
| 2014-07-01 14:36 | FirasH | Description Updated | |
| 2015-03-04 23:06 | Kunda | Note Added: 0034648 | |
| 2015-03-04 23:06 | Kunda | Patch | => No |
| 2015-03-04 23:06 | Kunda | Target Version | => Future Release - Nice to have |
| 2015-09-23 13:15 | FirasH | Relationship added | child of 0012500 |
| 2016-12-11 21:01 | Kunda | Target Version | Future Release - Nice to have => Future Release - Low Priority |
| 2026-08-23 10:54 | buttar | Note Added: 0054289 | |
| 2026-08-23 10:54 | buttar | File Added: fix-actionhistory-xy-ruler-offset-report.pdf | |
| 2026-08-23 10:54 | buttar | File Added: fix-actionhistory-xy-ruler-offset-v2.2.patch | |
| 2026-08-23 10:54 | buttar | Tag Attached: #please_test |