r17842 by jghali - #11070 : Snap to Items indicator misplaced when document has bleed area (additional fix)
scribus-commit
scribus-commit at lists.scribus.net
Sun Oct 28 23:33:01 UTC 2012
Author: jghali
Date: Sun Oct 28 23:33:01 2012
New Revision: 17842
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17842
Log:
#11070 : Snap to Items indicator misplaced when document has bleed area (additional fix)
Modified:
trunk/Scribus/scribus/canvasmode.cpp
Modified: trunk/Scribus/scribus/canvasmode.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17842&path=/trunk/Scribus/scribus/canvasmode.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode.cpp (original)
+++ trunk/Scribus/scribus/canvasmode.cpp Sun Oct 28 23:33:01 2012
@@ -770,13 +770,15 @@
{
if (m_doc->SnapElement)
{
- MarginStruct bleedValues = m_doc->bleedsVal();
- QPointF pageOffset = QPointF(m_doc->currentPage()->xOffset(), m_doc->currentPage()->yOffset());
- QPoint pageOrigin = m_canvas->canvasToLocal(pageOffset);
+ MarginStruct bleedValues;
+ m_doc->getBleeds(m_doc->currentPage(), bleedValues);
+ double xOffset = m_doc->currentPage()->xOffset() - bleedValues.Left;
+ double yOffset = m_doc->currentPage()->yOffset() - bleedValues.Top;
+ QPoint pageOrigin = m_canvas->canvasToLocal(QPointF(xOffset, yOffset));
if (ySnap)
{
p->setPen(Qt::green);
- QPoint pt = m_canvas->canvasToLocal(QPointF(pageOffset.x(), ySnap));
+ QPoint pt = m_canvas->canvasToLocal(QPointF(xOffset, ySnap));
double w = (m_doc->currentPage()->width() + bleedValues.Left + bleedValues.Right) * m_canvas->scale();
p->drawLine(pageOrigin.x(), pt.y(), pageOrigin.x() + w, pt.y());
ySnap = 0;
@@ -784,7 +786,7 @@
if (xSnap)
{
p->setPen(Qt::green);
- QPoint pt = m_canvas->canvasToLocal(QPointF(xSnap, pageOffset.y()));
+ QPoint pt = m_canvas->canvasToLocal(QPointF(xSnap, yOffset));
double h = (m_doc->currentPage()->height() + bleedValues.Bottom + bleedValues.Top) * m_canvas->scale();
p->drawLine(pt.x(), pageOrigin.y(), pt.x(), pageOrigin.y() + h);
xSnap = 0;
More information about the scribus-commit
mailing list