r14140 by jghali - #8362: snapping to guides/margins moves frames/objects, not resizes

scribus-commit scribus-commit at lists.scribus.net
Sun Oct 11 21:45:18 CEST 2009


Revision: 14140
Author: jghali
Date: 2009-10-11T18:40:06.442736Z
Commit message: #8362: snapping to guides/margins moves frames/objects, not resizes 

Changeset: 
M  /branches/Version135/Scribus/scribus/canvasmode_create.cpp

Diffs:
Index: scribus/canvasmode_create.cpp
===================================================================
--- scribus/canvasmode_create.cpp	(revision 14139)
+++ scribus/canvasmode_create.cpp	(revision 14140)
@@ -306,7 +306,6 @@
 	modifiers = m->modifiers();
 	
 	double Rxp = 0, Ryp = 0;
-	double Rxpd = 0,Rypd = 0;
 	m_MouseButtonPressed = true;
 	m_view->HaveSelRect = false;
 	m_doc->DragP = false;
@@ -323,14 +322,13 @@
 	createObjectPos  = m_doc->ApplyGridF(canvasPressCoord);
 	
 	Rxp  = m_doc->ApplyGridF(canvasPressCoord).x();
-	Rxpd = canvasPressCoord.x() - Rxp;
 	canvasPressCoord.setX(qRound(Rxp));
 	Ryp  = m_doc->ApplyGridF(canvasPressCoord).y();
-	Rypd = canvasPressCoord.y() - Ryp;
-
 	canvasPressCoord.setXY(qRound(Rxp), qRound(Ryp));
 	canvasCurrCoord = canvasPressCoord;
+	m_doc->ApplyGuides(&Rxp, &Ryp);
 	createObjectPos.setXY(Rxp, Ryp);
+
 	if (m->button() == Qt::MidButton)
 	{
 		m_view->MidButt = true;
@@ -582,7 +580,6 @@
 			}
 			else
 			{
-				m_doc->ApplyGuides(&Rxp, &Ryp);
 				z = m_doc->itemAdd(PageItem::Polygon, PageItem::Rectangle, Rxp, Ryp, Rxpd, Rypd, m_doc->toolSettings.dWidth, m_doc->toolSettings.dBrush, m_doc->toolSettings.dPen, true);
 				m_doc->Items->at(z)->FrameType = 0;
 			}
@@ -595,7 +592,6 @@
 			}
 			else
 			{
-				m_doc->ApplyGuides(&Rxp, &Ryp);
 				z = m_doc->itemAdd(PageItem::Polygon, PageItem::Ellipse, Rxp, Ryp, Rxpd, Rypd, m_doc->toolSettings.dWidth, m_doc->toolSettings.dBrush, m_doc->toolSettings.dPen, true);
 				m_doc->Items->at(z)->FrameType = 1;
 			}
@@ -611,7 +607,6 @@
 			}
 			else
 			{
-				m_doc->ApplyGuides(&Rxp, &Ryp);
 				z = m_doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, Rxp, Ryp, Rxpd, Rypd, m_doc->toolSettings.dWidth, m_doc->toolSettings.dBrush, m_doc->toolSettings.dPen, true);
 				m_doc->Items->at(z)->SetFrameShape(m_doc->ValCount, m_doc->ShapeValues);
 				m_doc->AdjustItemSize(m_doc->Items->at(z));
@@ -640,7 +635,6 @@
 		}
 		else
 		{
-			m_doc->ApplyGuides(&Rxp, &Ryp);
 			z = m_doc->itemAdd(PageItem::LatexFrame, PageItem::Unspecified, Rxp, Ryp, Rxpd, Rypd, m_doc->toolSettings.dWidth, m_doc->toolSettings.dBrushPict, CommonStrings::None, true);
 		}
 		break;
@@ -651,7 +645,6 @@
 		}
 		else
 		{
-			m_doc->ApplyGuides(&Rxp, &Ryp);
 			z = m_doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, Rxp, Ryp, Rxpd, Rypd, m_doc->toolSettings.dWidth, m_doc->toolSettings.dBrushPict, CommonStrings::None, true);
 		}
 		break;
@@ -662,7 +655,6 @@
 		}	
 		else
 		{
-			m_doc->ApplyGuides(&Rxp, &Ryp);
 			z = m_doc->itemAdd(PageItem::TextFrame, PageItem::Unspecified, Rxp, Ryp, Rxpd, Rypd, m_doc->toolSettings.dWidth, CommonStrings::None, m_doc->toolSettings.dPenText, true);
 		}
 		break;
@@ -672,7 +664,6 @@
 				z = m_doc->itemAddArea(PageItem::Polygon, PageItem::Unspecified, Rxp, Ryp, m_doc->toolSettings.dWidth, m_doc->toolSettings.dBrush, m_doc->toolSettings.dPen, true);
 			else
 			{
-				m_doc->ApplyGuides(&Rxp, &Ryp);
 				z = m_doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, Rxp, Ryp, Rxpd, Rypd, m_doc->toolSettings.dWidth, m_doc->toolSettings.dBrush, m_doc->toolSettings.dPen, true);
 			}
 			currItem = m_doc->Items->at(z);
@@ -708,7 +699,6 @@
 	case modeInsertPDFListbox:
 	case modeInsertPDFTextAnnotation:
 	case modeInsertPDFLinkAnnotation:
-		m_doc->ApplyGuides(&Rxp, &Ryp);
 		z = m_doc->itemAdd(PageItem::TextFrame, PageItem::Unspecified, Rxp, Ryp, Rxpd, Rypd, m_doc->toolSettings.dWidth, CommonStrings::None, m_doc->toolSettings.dPenText, true);
 		currItem = m_doc->Items->at(z);
 		currItem->setIsAnnotation(true);




More information about the scribus-commit mailing list