r17779 by jghali - fix issue when creating table moving by moving mouse from bottom-left to top-right corner

scribus-commit scribus-commit at lists.scribus.net
Thu Sep 27 22:39:05 UTC 2012


Author: jghali
Date: Thu Sep 27 22:39:05 2012
New Revision: 17779

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17779
Log:
fix issue when creating table moving by moving mouse from bottom-left to top-right corner

Modified:
    branches/Version14x/Scribus/scribus/canvasmode_create.cpp

Modified: branches/Version14x/Scribus/scribus/canvasmode_create.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17779&path=/branches/Version14x/Scribus/scribus/canvasmode_create.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/canvasmode_create.cpp (original)
+++ branches/Version14x/Scribus/scribus/canvasmode_create.cpp Thu Sep 27 22:39:05 2012
@@ -801,23 +801,25 @@
 
 		if ((m_doc->m_Selection->count() == 0) && (m_view->HaveSelRect) && (!m_view->MidButt))
 		{
+			int    Cols, Rows;
+			double Tx, Ty, Tw, Th;
+			double deltaX, deltaY, offX, offY;
 			UndoTransaction * activeTransaction = NULL;
 			m_view->HaveSelRect = false;
-			double Tx, Ty, Tw, Th;
 			FPoint np2 = m_doc->ApplyGridF(canvasPressCoord);
-			Tx = np2.x();
-			Ty = np2.y();
-			m_doc->ApplyGuides(&Tx, &Ty);
-			canvasPressCoord.setXY(qRound(Tx), qRound(Ty));
+			double Tx1 = np2.x();
+			double Ty1 = np2.y();
+			m_doc->ApplyGuides(&Tx1, &Ty1);
+			canvasPressCoord.setXY(qRound(Tx1), qRound(Ty1));
 			np2 = m_doc->ApplyGridF(canvasCurrCoord);
-			Tw = np2.x();
-			Th = np2.y();
-			m_doc->ApplyGuides(&Tw, &Th);
-			canvasCurrCoord.setXY(qRound(Tw), qRound(Th));
-			Tw = Tw - Tx;
-			Th = Th - Ty;
-			int Cols, Rows;
-			double deltaX, deltaY, offX, offY;
+			double Tx2 = np2.x();
+			double Ty2 = np2.y();
+			m_doc->ApplyGuides(&Tx2, &Ty2);
+			canvasCurrCoord.setXY(qRound(Tx2), qRound(Ty2));
+			Tx = qMin(Tx1, Tx2);
+			Ty = qMin(Ty1, Ty2);
+			Tw = qAbs(Tx2 - Tx1);
+			Th = qAbs(Ty2 - Ty1);
 			if ((Th < 6) || (Tw < 6))
 			{
 				m_view->requestMode(submodePaintingDone);




More information about the scribus-commit mailing list