r17244 by fschmid - Fixed Bug 10541: "Guides jumping around on mouse click"

scribus-commit scribus-commit at lists.scribus.net
Thu Jan 26 22:30:55 UTC 2012


Author: fschmid
Date: Thu Jan 26 22:30:54 2012
New Revision: 17244

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17244
Log:
Fixed Bug 10541: "Guides jumping around on mouse click"

Modified:
    trunk/Scribus/scribus/canvasgesture_rulermove.cpp

Modified: trunk/Scribus/scribus/canvasgesture_rulermove.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17244&path=/trunk/Scribus/scribus/canvasgesture_rulermove.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_rulermove.cpp (original)
+++ trunk/Scribus/scribus/canvasgesture_rulermove.cpp Thu Jan 26 22:30:54 2012
@@ -286,25 +286,31 @@
 
 void RulerGesture::mouseMoveEvent(QMouseEvent* m)
 {
-	movePoint(m, false);
 	m->accept();
-	if (m_ScMW->doc->guidesPrefs().guidesShown)
-		emit guideInfo(m_mode, m_currentGuide);
+	if (m_view->moveTimerElapsed())
+	{
+		movePoint(m, false);
+		if (m_ScMW->doc->guidesPrefs().guidesShown)
+			emit guideInfo(m_mode, m_currentGuide);
+	}
 }
 
 
 void RulerGesture::mouseReleaseEvent(QMouseEvent* m)
 {
-	movePoint(m, true);
-	if (m_mode == ORIGIN)
-		m_view->setNewRulerOrigin(m);
-	else
-	{
-		if (m_ScMW->doc->guidesPrefs().guidesShown)
-			m_ScMW->guidePalette->setupPage();
-	}
-	m_haveGuide = false;
 	m->accept();
+	if (m_view->moveTimerElapsed())
+	{
+		movePoint(m, true);
+		if (m_mode == ORIGIN)
+			m_view->setNewRulerOrigin(m);
+		else
+		{
+			if (m_ScMW->doc->guidesPrefs().guidesShown)
+				m_ScMW->guidePalette->setupPage();
+		}
+	}
+	m_haveGuide = false;
 	m_canvas->repaint();
 	m_view->stopGesture();
 	if (m_ScMW->doc->guidesPrefs().guidesShown)
@@ -314,11 +320,12 @@
 
 void RulerGesture::mousePressEvent(QMouseEvent* m)
 {
+	m->accept();
 	FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
+	m_view->registerMousePress(m->globalPos());
 	if (mouseHitsGuide(mousePointDoc))
 	{
 		m_xy = m->globalPos() - (m_canvas->mapToParent(QPoint(0, 0)) + m_canvas->parentWidget()->mapToGlobal(QPoint(0, 0)));
-		m->accept();
 	}
 	if (m_ScMW->doc->guidesPrefs().guidesShown)
 		emit guideInfo(m_mode, m_currentGuide);




More information about the scribus-commit mailing list