r14921 by jghali - #8960: Initial drawing of a line with Ctrl doesn't produce the correct angles

scribus-commit scribus-commit at lists.scribus.net
Sun Mar 21 20:00:20 CET 2010


Revision: 14921
Author: jghali
Date: 2010-03-21T18:59:10.411828Z
Commit message: #8960: Initial drawing of a line with Ctrl doesn't produce the correct angles

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

Diffs:
Index: scribus/canvasmode_create.cpp
===================================================================
--- scribus/canvasmode_create.cpp	(revision 14920)
+++ scribus/canvasmode_create.cpp	(revision 14921)
@@ -253,7 +253,7 @@
 				}
 				if (m->modifiers() & Qt::ControlModifier)
 				{
-					QRectF bounds(QPoint(createObjectPos.x(), createObjectPos.y()), QPoint(newX, newY));
+					QRectF bounds(QPointF(createObjectPos.x(), createObjectPos.y()), QPointF(newX, newY));
 					double newRot = xy2Deg(bounds.width(), bounds.height());
 					if (newRot < 0.0)
 						newRot += 360;
@@ -271,8 +271,10 @@
 				double nx = np2.x();
 				double ny = np2.y();
 				m_doc->ApplyGuides(&nx, &ny);
-				newX = qRound(nx);
-				newY = qRound(ny);
+				// #8959 : suppress qRound here as this prevent drawing line with angle constrain
+				// precisely and does not allow to stick precisely to grid or guides
+				newX = /*qRound(*/nx/*)*/;
+				newY = /*qRound(*/ny/*)*/;
 			//}
 			canvasCurrCoord.setXY(newX, newY);
 			m_view->HaveSelRect = true;




More information about the scribus-commit mailing list