[Uml-devel] branches/work/soc-umbrello/umbrello

Gopala Krishna A krishna.ggk at gmail.com
Mon Aug 11 16:41:56 UTC 2008


SVN commit 845429 by gopala:

Fixed DrawAsActor drawing. Should have tested before!



 M  +12 -14    objectwidget.cpp  


--- branches/work/soc-umbrello/umbrello/objectwidget.cpp #845428:845429
@@ -209,14 +209,16 @@
  */
 void ObjectWidget::adjustSequentialLineEnd()
 {
-    qreal lowestMessage = 0;
-    foreach ( MessageWidget* message, m_messages ) {
-        qreal messageHeight = message->y() + message->size().height();
-        if (lowestMessage < messageHeight) {
-            lowestMessage = messageHeight;
+    if (!m_messages.isEmpty()) {
+        qreal lowestMessage = 0;
+        foreach ( MessageWidget* message, m_messages ) {
+            qreal messageHeight = message->y() + message->size().height();
+            if (lowestMessage < messageHeight) {
+                lowestMessage = messageHeight;
+            }
         }
+        m_sequentialLine->setEndOfLine(lowestMessage + ObjectWidget::SequenceLineMargin);
     }
-    m_sequentialLine->setEndOfLine(lowestMessage + ObjectWidget::SequenceLineMargin);
 }
 
 /**
@@ -353,11 +355,13 @@
 {
     TextItemGroup *grp = textItemGroupAt(0);
     QSizeF minSize = grp->minimumSize();
+    setMargin(5);
     if (m_drawAsActor) {
         minSize.rheight() += ObjectWidget::ActorSize.height();
         if (minSize.width() < ObjectWidget::ActorSize.width()) {
             minSize.setWidth(ObjectWidget::ActorSize.width());
         }
+        setMargin(0);
     }
     setMinimumSize(minSize);
     setMaximumSize(QSizeF(NewUMLRectWidget::DefaultMaximumSize.width(),
@@ -438,15 +442,9 @@
             // NOTE: Copy-pasted from ActorWidget::attributeChange!!
 
             // Now calculate actorPath
-            qreal actorHeight = r.top() - m;
-            qreal actorWidth = r.width();
+            qreal actorHeight = ActorSize.height();
+            qreal actorWidth = ActorSize.width();
 
-            // Make sure width of actor isn't too much, it looks ugly otherwise.
-            if(actorWidth > .5 * actorHeight) {
-                actorWidth = .5 * actorHeight;
-            }
-            //TODO: Probably use above similar approach to limit height.
-
             QRectF headEllipse;
             headEllipse.setTopLeft(QPointF(.5 * (curSize.width() - actorWidth), m));
             headEllipse.setSize(QSizeF(actorWidth, actorHeight / 3));




More information about the umbrello-devel mailing list