[Uml-devel] kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Tue Nov 16 12:33:02 UTC 2004
CVS commit by okellogg:
Fix mouse motion of creation message.
M +9 -25 messagewidget.cpp 1.60
--- kdesdk/umbrello/umbrello/messagewidget.cpp #1.59:1.60
@@ -221,22 +221,9 @@ void MessageWidget::drawCreation(QPainte
int x2 = m_pOw[Uml::B]->getX();
int w = getWidth() - 1;
- int h = getHeight() - 1;
+ //int h = getHeight() - 1;
bool messageOverlapsA = m_pOw[Uml::A] -> messageOverlap( getY(), this );
//bool messageOverlapsB = m_pOw[Uml::B] -> messageOverlap( getY(), this );
- if(m_pOw[Uml::A] == m_pOw[Uml::B]) {
- if (messageOverlapsA) {
- offsetX += 7;
- w -= 7;
- }
- p.drawLine(offsetX, offsetY, offsetX + w, offsetY);
- p.drawLine(offsetX + w, offsetY, offsetX + w, offsetY + h - 3);
- p.drawLine(offsetX + w, offsetY + h - 3, offsetX, offsetY + h - 3);
- p.drawLine(offsetX, offsetY + h - 3, offsetX + 4, offsetY + h);
- p.drawLine(offsetX, offsetY + h - 3, offsetX + 4, offsetY + h - 6);
- if (messageOverlapsA) {
- offsetX -= 7; //reset for drawSelected()
- }
- } else if(x1 < x2) {
+ if (x1 < x2) {
if (messageOverlapsA) {
offsetX += 7;
@@ -601,13 +588,5 @@ void MessageWidget::calculateDimensionsC
int widgetWidth = 0;
int widgetHeight = 8;
- if( m_pOw[Uml::A] == m_pOw[Uml::B] ) {
- widgetWidth = 50;
- x = x1;
- if( height() < 20 ) {
- widgetHeight = 20;
- } else {
- widgetHeight = height();
- }
- } else if( x1 < x2 ) {
+ if ( x1 < x2 ) {
x = x1;
widgetWidth = x2 - x1;
@@ -698,4 +677,8 @@ void MessageWidget::mouseMoveEvent(QMous
setY( newY );
adjustAssocs(newX, newY);
+ if (m_sequenceMessageType == Uml::sequence_message_creation) {
+ const int objWidgetHalfHeight = m_pOw[Uml::B]->getHeight() / 2;
+ m_pOw[Uml::B]->UMLWidget::setY( newY - objWidgetHalfHeight );
+ }
moveEvent(0);
}
@@ -721,5 +704,6 @@ void MessageWidget::setSelected(bool _se
int MessageWidget::getMinHeight() {
- if( !m_pOw[Uml::A] || !m_pOw[Uml::B] ) {
+ if (!m_pOw[Uml::A] || !m_pOw[Uml::B] ||
+ m_sequenceMessageType == Uml::sequence_message_creation) {
return 0;
}
More information about the umbrello-devel
mailing list