[Uml-devel] branches/KDE/3.5/kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Sat Dec 10 08:45:02 UTC 2005


SVN commit 487437 by okellogg:

constrainTextPos(): Relax the constraint for connections shorter than textWidth itself.

 M  +3 -1      associationwidget.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/associationwidget.cpp #487436:487437
@@ -1885,7 +1885,9 @@
     const int y0 = p0.y();
     const int x1 = p1.x();
     const int y1 = p1.y();
-    const double r = sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)) / 2;
+    double r = sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)) / 2;
+    if (textWidth > r)
+        r = textWidth;
     const int relX = textCenterY - midP.x();  // NB: text{X,Y} are swapped to
     const int relY = textCenterX - midP.y();  //     convert from Qt coord.system.
     // circle equation:  x*x + y*y - r*r = 0




More information about the umbrello-devel mailing list