Version: 1.5.51 (using KDE KDE 3.5.5) Installed from: Compiled From Sources When you enable 'Snap To Grid' on an activity diagram, it becomes very difficult to move text and labels on associations.
I can confirm availability in 1.5.6 too.
Experienced same behaviour in 1.5.72 today.
SVN commit 677410 by okellogg: moveWidgetBy(): Remove unwarranted return. CCBUG:137041 M +4 -3 floatingtextwidgetcontroller.cpp --- branches/KDE/3.5/kdesdk/umbrello/umbrello/floatingtextwidgetcontroller.cpp #677409:677410 @@ -9,8 +9,11 @@ * Umbrello UML Modeller Authors <uml-devel@uml.sf.net> * ***************************************************************************/ +// own header +#include "floatingtextwidgetcontroller.h" +// qt/kde includes +#include <kdebug.h> // app includes -#include "floatingtextwidgetcontroller.h" #include "floatingtextwidget.h" #include "messagewidget.h" #include "objectwidget.h" @@ -74,8 +77,6 @@ (m_movementDirectionY > 0 && m_unconstrainedPositionY < m_floatingTextWidget->getY()) ) { newY = m_unconstrainedPositionY; m_movementDirectionY = 0; - } else { - return; } m_floatingTextWidget->setX(newX);
SVN commit 677414 by okellogg: getPositionDifference(): Consider m_old{X,Y} on computing new{X,Y}. Update m_old{X,Y} with the newly computed values. BUG:137041 M +1 -0 ChangeLog M +24 -4 umbrello/umlwidgetcontroller.cpp --- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #677413:677414 @@ -1,6 +1,7 @@ Version 1.5.72 * Bugs/wishes from http://bugs.kde.org: +* Cannot move text and label correctly after enabling snap to grid (137041) * Wrong pascal code generation (146676) * Crash when linking to undefined xmi.id (146748) * End Activity Symbol gets invalid when line thickness is increased (146925) --- branches/KDE/3.5/kdesdk/umbrello/umbrello/umlwidgetcontroller.cpp #677413:677414 @@ -140,13 +140,17 @@ if ((me->state() & Qt::ShiftButton) && (me->state() & Qt::ControlButton)) { //Move in Y axis - diffX = m_oldX - m_widget->getX(); + diffX = 0; } else if ((me->state() & Qt::ShiftButton) || (me->state() & Qt::ControlButton)) { //Move in X axis - diffY = m_oldY - m_widget->getY(); + diffY = 0; } + // kDebug() << "UMLWidgetController::mouseMoveEvent before constrainMovementForAllWidgets:" + // << " diffX=" << diffX << ", diffY=" << diffY << endl; constrainMovementForAllWidgets(diffX, diffY); + // kDebug() << "UMLWidgetController::mouseMoveEvent after constrainMovementForAllWidgets:" + // << " diffX=" << diffX << ", diffY=" << diffY << endl; //Nothing to move if (diffX == 0 && diffY == 0) { @@ -172,6 +176,7 @@ ++it; widget->getWidgetController()->moveWidgetBy(diffX, diffY); } + // kDebug() << endl; // Move any selected associations. AssociationWidgetList awl = m_widget->m_pView->getSelectedAssocs(); @@ -477,21 +482,36 @@ } QPoint UMLWidgetController::getPositionDifference(QMouseEvent* me) { - int newX = me->x() - m_pressOffsetX; - int newY = me->y() - m_pressOffsetY; + /* + kDebug() << "UMLWidgetController::getPositionDifference: me->x=" << me->x() + << " m_widget->getX=" << m_widget->getX() << ", m_oldX=" << m_oldX + << ", m_pressOffsetX=" << m_pressOffsetX << endl; + kDebug() << "UMLWidgetController::getPositionDifference: me->y=" << me->y() + << " m_widget->getY=" << m_widget->getY() << ", m_oldY=" << m_oldY + << ", m_pressOffsetY=" << m_pressOffsetY << endl; + */ + int newX = me->x() + m_widget->getX() - m_oldX - m_pressOffsetX; + int newY = me->y() + m_widget->getY() - m_oldY - m_pressOffsetY; int maxX = m_widget->m_pView->canvas()->width(); int maxY = m_widget->m_pView->canvas()->height(); + m_oldX = newX; + m_oldY = newY; + if (newX + (m_minSelectedX - m_widget->getX()) < 0) { + //kDebug() << "UMLWidgetController::getPositionDifference: got into cond.1" << endl; newX = m_widget->getX() - m_minSelectedX; } if (newY + (m_minSelectedY - m_widget->getY()) < 0) { + //kDebug() << "UMLWidgetController::getPositionDifference: got into cond.2" << endl; newY = m_widget->getY() - m_minSelectedY; } if (newX + (m_maxSelectedX - m_widget->getX()) > maxX) { + //kDebug() << "UMLWidgetController::getPositionDifference: got into cond.3" << endl; newX = maxX - (m_maxSelectedX - m_widget->getX()); } if (newY + (m_maxSelectedY - m_widget->getY()) > maxY) { + //kDebug() << "UMLWidgetController::getPositionDifference: got into cond.4" << endl; newY = maxY - (m_maxSelectedY - m_widget->getY()); }