[Uml-devel] CVS: kdesdk/umbrello/umbrello umlview.cpp,1.10,1.11 umlwidget.cpp,1.4,1.5

kde at office.kde.org kde at office.kde.org
Sat Feb 1 17:53:01 UTC 2003


Update of /home/kde/kdesdk/umbrello/umbrello
In directory office:/tmp/cvs-serv2486

Modified Files:
	umlview.cpp umlwidget.cpp 
Log Message:
right mouse button menu now pops up at the correct spot when
diagram is zoomed


Index: umlview.cpp
===================================================================
RCS file: /home/kde/kdesdk/umbrello/umbrello/umlview.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- umlview.cpp	1 Feb 2003 22:39:06 -0000	1.10
+++ umlview.cpp	2 Feb 2003 01:52:07 -0000	1.11
@@ -203,10 +203,9 @@
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 void UMLView::contentsMouseReleaseEvent(QMouseEvent* ome) {
 
-	QMouseEvent *me = new QMouseEvent(QEvent::MouseButtonRelease,
-																	 inverseWorldMatrix().map(ome->pos()),
-																		ome->button(),
-																		ome->state());
+	QMouseEvent *me = new QMouseEvent(QEvent::MouseButtonRelease, inverseWorldMatrix().map(ome->pos()),
+					  ome->button(),ome->state());
+
 	if(m_bDrawRect) {
 		viewport()->setMouseTracking( false );
 		m_bDrawRect = false;
@@ -2349,7 +2348,7 @@
 	if( menu != ListPopupMenu::mt_Undefined ) {
 		m_pMenu = new ListPopupMenu(this, menu, this);
 		connect(m_pMenu, SIGNAL(activated(int)), this, SLOT(slotMenuSelection(int)));
-		m_pMenu->popup( mapToGlobal( contentsToViewport(m_Pos) ) );
+		m_pMenu->popup( mapToGlobal( contentsToViewport(worldMatrix().map(m_Pos)) ) );
 	}
 }
 

Index: umlwidget.cpp
===================================================================
RCS file: /home/kde/kdesdk/umbrello/umbrello/umlwidget.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- umlwidget.cpp	2 Feb 2003 00:47:42 -0000	1.4
+++ umlwidget.cpp	2 Feb 2003 01:52:07 -0000	1.5
@@ -232,9 +232,10 @@
 		m_bShiftPressed = false; // reset the state
 	}
 	if( me->button() == RightButton ) {
-		if( m_pMenu )
+		if (m_pMenu) {
 			return;
-		startPopupMenu( m_pView -> mapToGlobal( m_pView -> contentsToViewport( me -> pos() ) ) );
+		}
+		startPopupMenu( me->globalPos() );
 		return;
 	}//end if right button
 	m_pView -> getDocument() -> setModified(true);





More information about the umbrello-devel mailing list