[Uml-devel] kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Sat Oct 2 14:01:35 UTC 2004
CVS commit by okellogg:
Fix bug 80559 (resizing of objects doesn't snap to grid)
M +8 -2 boxwidget.cpp 1.10
M +8 -2 notewidget.cpp 1.25
--- kdesdk/umbrello/umbrello/boxwidget.cpp #1.9:1.10
@@ -49,6 +49,12 @@ void BoxWidget::mouseMoveEvent(QMouseEve
if( !m_bMouseDown )
return;
- int newW = m_nOldW + me->x()- m_nOldX - m_nPressOffsetX;
- int newH = m_nOldH + me->y()- m_nOldY - m_nPressOffsetY;
+ int newX = me->x();
+ int newY = me->y();
+ if (! m_bIgnoreSnapToGrid) {
+ newX = m_pView->snappedX( newX );
+ newY = m_pView->snappedY( newY );
+ }
+ int newW = m_nOldW + newX - m_nOldX - m_nPressOffsetX;
+ int newH = m_nOldH + newY - m_nOldY - m_nPressOffsetY;
newW = newW < 20?20:newW;
newH = newH < 20?20:newH;
--- kdesdk/umbrello/umbrello/notewidget.cpp #1.24:1.25
@@ -73,6 +73,12 @@ void NoteWidget::mouseMoveEvent(QMouseEv
if( !m_bMouseDown )
return;
- int newW = m_nOldW + me->x()- m_nOldX - m_nPressOffsetX;
- int newH = m_nOldH + me->y()- m_nOldY - m_nPressOffsetY;
+ int newX = me->x();
+ int newY = me->y();
+ if (! m_bIgnoreSnapToGrid) {
+ newX = m_pView->snappedX( newX );
+ newY = m_pView->snappedY( newY );
+ }
+ int newW = m_nOldW + newX - m_nOldX - m_nPressOffsetX;
+ int newH = m_nOldH + newY - m_nOldY - m_nPressOffsetY;
newW = newW < 50?50:newW;
newH = newH < 50?50:newH;
More information about the umbrello-devel
mailing list