r14996 by jghali - #9002: Resize points undraggable when object is aligned to a guide

scribus-commit scribus-commit at lists.scribus.net
Thu Apr 22 01:30:42 CEST 2010


Revision: 14996
Author: jghali
Date: 2010-04-21T23:27:43.260926Z
Commit message: #9002: Resize points undraggable when object is aligned to a guide

Changeset: 
M  /trunk/Scribus/scribus/canvasmode_normal.cpp
M  /trunk/Scribus/win32/vc8/Scribus-build.vsprops

Diffs:
Index: scribus/canvasmode_normal.cpp
===================================================================
--- scribus/canvasmode_normal.cpp	(revision 14995)
+++ scribus/canvasmode_normal.cpp	(revision 14996)
@@ -259,7 +259,21 @@
 	m_mouseCurrentPoint = mousePointDoc;
 	if ((m_doc->guidesPrefs().guidesShown) && (!m_doc->GuideLock) && (m_doc->OnPage(mousePointDoc.x(), mousePointDoc.y()) != -1) )
 	{
-		if( ((m_doc->guidesPrefs().guidePlacement) && (m_canvas->itemUnderCursor(m->globalPos()))) == false )
+		// #9002: Resize points undraggable when object is aligned to a guide
+		// Allow item resize when guides are aligned to item while preserving
+		// ability to drag guide when guis is in foreground and inside selection
+		bool enableGuideGesture(false);
+		Canvas::FrameHandle frameResizeHandle(Canvas::OUTSIDE);
+		if (m_doc->m_Selection->count() > 0)
+		{
+			double gx(0.0), gy(0.0), gw(0.0), gh(0.0);
+			m_doc->m_Selection->setGroupRect();
+			m_doc->m_Selection->getVisualGroupRect(&gx, &gy, &gw, &gh);
+			frameResizeHandle = m_canvas->frameHitTest(QPointF(mousePointDoc.x(),mousePointDoc.y()), QRectF(gx, gy, gw, gh));
+		}
+		enableGuideGesture |= (frameResizeHandle == Canvas::OUTSIDE);
+		enableGuideGesture |= ((!m_doc->guidesPrefs().guidePlacement) && (frameResizeHandle == Canvas::INSIDE));
+		if (enableGuideGesture)
 		{
 			if (!guideMoveGesture)
 			{
@@ -1038,28 +1052,43 @@
 
 	if(!m_doc->guidesPrefs().guidePlacement) // guides are on foreground and want to be processed first
 	{
-		if ((m_doc->guidesPrefs().guidesShown) /*&& (!m_doc->GuideLock)*/ && (m_doc->OnPage(MxpS, MypS) != -1))
+		if ((m_doc->guidesPrefs().guidesShown) && (m_doc->OnPage(MxpS, MypS) != -1))
 		{
-			if (!guideMoveGesture)
-			{
-				guideMoveGesture = new RulerGesture(m_view, RulerGesture::HORIZONTAL);
-				connect(guideMoveGesture,SIGNAL(guideInfo(int, qreal)), m_ScMW->alignDistributePalette,SLOT(setGuide(int, qreal)));
+			// #9002: Resize points undraggable when object is aligned to a guide
+			// Allow item resize when guides are aligned to item while preserving
+			// ability to drag guide when guis is in foreground and inside selection
+			bool enableGuideGesture(true);
+			if (m_doc->m_Selection->count() > 0)
+			{
+				double gx(0.0), gy(0.0), gw(0.0), gh(0.0);
+				m_doc->m_Selection->setGroupRect();
+				m_doc->m_Selection->getVisualGroupRect(&gx, &gy, &gw, &gh);
+				Canvas::FrameHandle frameResizeHandle = m_canvas->frameHitTest(QPointF(mousePointDoc.x(),mousePointDoc.y()), QRectF(gx, gy, gw, gh));
+				enableGuideGesture = (frameResizeHandle == Canvas::INSIDE);
 			}
-			if ( (!m_doc->GuideLock) && (guideMoveGesture->mouseHitsGuide(mousePointDoc)) )
+			if (enableGuideGesture)
 			{
-				m_view->startGesture(guideMoveGesture);
-				guideMoveGesture->mouseMoveEvent(m);
-				m_doc->m_Selection->connectItemToGUI();
-// 				qDebug()<<"Out Of SeleItem"<<__LINE__;
-				return true;
+				if (!guideMoveGesture)
+				{
+					guideMoveGesture = new RulerGesture(m_view, RulerGesture::HORIZONTAL);
+					connect(guideMoveGesture,SIGNAL(guideInfo(int, qreal)), m_ScMW->alignDistributePalette,SLOT(setGuide(int, qreal)));
+				}
+				if ( (!m_doc->GuideLock) && (guideMoveGesture->mouseHitsGuide(mousePointDoc)) )
+				{
+					m_view->startGesture(guideMoveGesture);
+					guideMoveGesture->mouseMoveEvent(m);
+					m_doc->m_Selection->connectItemToGUI();
+				//	qDebug()<<"Out Of SeleItem"<<__LINE__;
+					return true;
+				}
+				else
+				{
+				// If we call startGesture now, a new guide is created each time.
+				// ### could be a weakness to avoid calling it tho.
+	 			//	m_view->startGesture(guideMoveGesture);
+					guideMoveGesture->mouseSelectGuide(m);
+				}
 			}
-			else
-			{
-			// If we call startGesture now, a new guide is created each time.
-			// ### could be a weakness to avoid calling it tho.
-// 			m_view->startGesture(guideMoveGesture);
-				guideMoveGesture->mouseSelectGuide(m);
-			}
 		}
 	}
 	bool pageChanged(false);
Index: win32/vc8/Scribus-build.vsprops
===================================================================
--- win32/vc8/Scribus-build.vsprops	(revision 14995)
+++ win32/vc8/Scribus-build.vsprops	(revision 14996)
@@ -6,46 +6,58 @@
 	>
 	<UserMacro
 		Name="QT4_DIR"
-		Value="E:\Libs-msvc2005\qt-4.5.1"
+		Value="D:\Libraries-vc8\qt-4.6.1"
 	/>
 	<UserMacro
 		Name="BOOST_DIR"
-		Value="E:\Libs-msvc2005\boost-1.35.0"
+		Value="E:\Libraries-vc8\boost-1.35.0"
 	/>
 	<UserMacro
 		Name="CAIRO_DIR"
-		Value="E:\Libs-msvc2005\cairo-1.8.8"
+		Value="E:\Libraries-vc8\cairo-1.8.8"
 	/>
 	<UserMacro
 		Name="FREETYPE_DIR"
-		Value="E:\Libs-msvc2005\freetype-2.3.7"
+		Value="E:\Libraries-vc8\freetype-2.3.12"
 	/>
 	<UserMacro
 		Name="ICONV_DIR"
-		Value="E:\Libs-msvc2005\iconv-1.9.2"
+		Value="E:\Libraries-vc8\iconv-1.9.2"
 	/>
 	<UserMacro
 		Name="LCMS_DIR"
-		Value="E:\Libs-msvc2005\lcms-1.18"
+		Value="E:\Libraries-vc8\lcms-1.19"
 	/>
 	<UserMacro
 		Name="LIBJPEG_DIR"
-		Value="E:\Libs-msvc2005\libjpeg-6b-3"
+		Value="E:\Libraries-vc8\libjpeg-6b-3"
 	/>
 	<UserMacro
 		Name="LIBTIFF_DIR"
-		Value="E:\Libs-msvc2005\libtiff-3.8.2"
+		Value="E:\Libraries-vc8\libtiff-3.8.2"
 	/>
 	<UserMacro
 		Name="PODOFO_DIR"
-		Value="E:\Libs-msvc2005\podofo-0.7.0"
+		Value="E:\Libraries-vc8\podofo-0.7.0"
 	/>
 	<UserMacro
+		Name="LIBWPD_DIR"
+		Value="E:\Libraries-vc8\libwpd-0.8.14"
+	/>
+	<UserMacro
+		Name="LIBWPG_DIR"
+		Value="E:\Libraries-vc8\libwpg-0.1.3"
+	/>
+	<UserMacro
 		Name="LIBXML2_DIR"
-		Value="E:\Libs-msvc2005\libxml2-2.6.32+"
+		Value="E:\Libraries-vc8\libxml2-2.6.32+"
 	/>
 	<UserMacro
+		Name="OPENSCENEGRAPH_DIR"
+		Value="E:\Libraries-vc8\OpenSceneGraph-2.8.1"
+	/>
+	<UserMacro
 		Name="PYTHON_DIR"
-		Value="E:\Libs-msvc2005\Python-2.5.1"
+		Value="E:\Libraries-vc8\Python-2.5.4"
 	/>
 </VisualStudioPropertySheet>




More information about the scribus-commit mailing list