diff options
| author | jghali <jghali@11d20701-8431-0410-a711-e3c959e3b870> | 2012-04-19 21:22:11 +0000 |
|---|---|---|
| committer | jghali <jghali@11d20701-8431-0410-a711-e3c959e3b870> | 2012-04-19 21:22:11 +0000 |
| commit | d16f57ed50dad2ddd0203078e8e3853c57181e47 (patch) | |
| tree | dc7f91ed9af48dee94c9836fc00e837613ccd1f5 /scribus/canvasmode_normal.cpp | |
| parent | 983b23ad11dee69b5221e7650d67cbff91d1f69d (diff) | |
| download | scribus-d16f57ed50dad2ddd0203078e8e3853c57181e47.tar.gz scribus-d16f57ed50dad2ddd0203078e8e3853c57181e47.tar.xz scribus-d16f57ed50dad2ddd0203078e8e3853c57181e47.zip | |
#10677: snap are of by 0.353 mm on horizontal guides
git-svn-id: svn://scribus.net/branches/Version14x/Scribus@17462 11d20701-8431-0410-a711-e3c959e3b870
Diffstat (limited to 'scribus/canvasmode_normal.cpp')
| -rw-r--r-- | scribus/canvasmode_normal.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/scribus/canvasmode_normal.cpp b/scribus/canvasmode_normal.cpp index 091d8c9..8ae864c 100644 --- a/scribus/canvasmode_normal.cpp +++ b/scribus/canvasmode_normal.cpp @@ -41,6 +41,7 @@ #include "fpointarray.h" #include "hyphenator.h" #include "insertTable.h" +#include "pageitem_line.h" #include "pageitem_textframe.h" #include "pageselector.h" #include "prefscontext.h" @@ -395,6 +396,18 @@ void CanvasMode_Normal::mouseMoveEvent(QMouseEvent *m) m_objectDeltaPos.setXY(dX, dY); m_doc->m_Selection->setGroupRect(); m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh); + // #10677 : temporary hack : we need to introduce the + // concept of item snapping points to handle better + // the various types of items + if (currItem->isLine()) + { + QPointF startPoint = currItem->asLine()->startPoint(); + QPointF endPoint = currItem->asLine()->endPoint(); + gx = qMin(startPoint.x(), endPoint.x()); + gy = qMin(startPoint.y(), endPoint.y()); + gw = fabs(startPoint.x() - endPoint.x()); + gh = fabs(startPoint.y() - endPoint.y()); + } if (m_doc->SnapGuides) { double nx = gx + m_objectDeltaPos.x(); |
