[Uml-devel] CVS: kdesdk/umbrello/umbrello seqlinewidget.cpp,1.1,1.2

kde at office.kde.org kde at office.kde.org
Sat Feb 1 17:08:29 UTC 2003


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

Modified Files:
	seqlinewidget.cpp 
Log Message:
prevent sequence object vertical lines going lower than the size of the canvas


Index: seqlinewidget.cpp
===================================================================
RCS file: /home/kde/kdesdk/umbrello/umbrello/seqlinewidget.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- seqlinewidget.cpp	23 Jan 2003 22:21:13 -0000	1.1
+++ seqlinewidget.cpp	2 Feb 2003 01:06:46 -0000	1.2
@@ -66,17 +66,26 @@
 }
 
 void SeqLineWidget::mouseMoveEvent( QMouseEvent *me ) {
-	if( !m_bMouseDown )
-		return;
-	int dy = (int)me -> y() - m_nOffsetY - m_nOldY;
-	QPoint ep = endPoint();
-	int newY = (int)ep.y() + dy;
-	m_nOldY = newY;
-	QPoint sp = startPoint();
-	newY = newY < m_nMinY?m_nMinY:newY;
-	setPoints( sp.x(), sp.y(), sp.x(), newY );
-	m_nLengthY = newY - (int)m_pObject -> y() - m_pObject -> height();
-	moveDeconBox();
+	if( m_bMouseDown ) {
+		int dy = (int)me->y() - m_nOffsetY - m_nOldY;
+		QPoint ep = endPoint();
+		int newY = (int)ep.y() + dy;
+		m_nOldY = newY;
+		QPoint sp = startPoint();
+
+		if (newY < m_nMinY) {
+			newY = m_nMinY;
+		}
+
+		int maxY = m_pView->canvas()->height();
+		if (newY > maxY - 10) {
+			newY = maxY - 10;
+		}
+
+		setPoints( sp.x(), sp.y(), sp.x(), newY );
+		m_nLengthY = newY - (int)m_pObject->y() - m_pObject->height();
+		moveDeconBox();
+	}
 }
 
 void SeqLineWidget::mouseReleaseEvent( QMouseEvent * /*me*/ ) {





More information about the umbrello-devel mailing list