summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjghali <jghali@11d20701-8431-0410-a711-e3c959e3b870>2012-09-27 22:39:05 +0000
committerjghali <jghali@11d20701-8431-0410-a711-e3c959e3b870>2012-09-27 22:39:05 +0000
commit0afad437fe816bf593833d9b6b5209d914a7cb37 (patch)
treed7a4e92b14892bebb936eec2cdfc0e3f93a216a8
parent7a724c8f0114b301b8d526906bde12dbe7a58de7 (diff)
downloadscribus-master.tar.gz
scribus-master.tar.xz
scribus-master.zip
fix issue when creating table moving by moving mouse from bottom-left to top-right cornerHEADmaster
git-svn-id: svn://scribus.net/branches/Version14x/Scribus@17779 11d20701-8431-0410-a711-e3c959e3b870
-rw-r--r--scribus/canvasmode_create.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/scribus/canvasmode_create.cpp b/scribus/canvasmode_create.cpp
index 3531076..aa4c5a5 100644
--- a/scribus/canvasmode_create.cpp
+++ b/scribus/canvasmode_create.cpp
@@ -801,23 +801,25 @@ PageItem* CreateMode::doCreateNewObject(void)
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);