svn commit: r16139 - trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/PathItemPlacement.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: dthompson
Date: 2008-11-22 12:21:22-0800
New Revision: 16139

Modified:
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/PathItemPlacement.java

Log:
Issue 1048: Improved auto placement of labels in new PathItemPlacement class.

Angle of displacement vector for placing labels is now relative to slope of the FigEdge at the anchor point (previously behaved as though angle was relative to overall link).  Note: PathItemPlacement isn't used anywhere yet.

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/PathItemPlacement.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/PathItemPlacement.java?view=diff&rev=16139&p1=trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/PathItemPlacement.java&p2=trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/PathItemPlacement.java&r1=16138&r2=16139
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/PathItemPlacement.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/PathItemPlacement.java	2008-11-22 12:21:22-0800
@@ -456,9 +456,7 @@
         // give screwy results near bends in the path
         int d1 = Math.max(0, pathDistance - slopeSegLen / 2);
         // If our position was clamped, try to make it up on the other end
-        int d2 = Math.max(slopeSegLen / 2, slopeSegLen - d1);
-        d2 = Math.max(pathLength - 1, pathDistance + d2);
-
+        int d2 = Math.min(pathLength - 1, d1 + slopeSegLen);
         // Can't get the slope of a point.  Just return an arbitrary point.
         if (d1 == d2) {
             return 0;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.