Community
Participate
Working Groups
Build ID: I20070608-1718 I have a polyline connection with polyline decorations using the defaults, except for a larger line width (5). The line shows up past the decoration, which looks bad and I don't believe is intended. I tried scaling the decoration, but that didn't help. I can post screenshots if that would be helpful.
(In reply to comment #0) > [snip] I can post screenshots if that would be > helpful. > Please do post some screenshots.
Created attachment 83087 [details] ss showing line extending pastdest decoration Here you go Anthony. If you want to put this one on a bugday, I wouldn't mind taking a look at a fix.
Created attachment 83088 [details] ss2 showing lines extending past decoration
The line does not extend past the tip of the triangle. The line is simply capped with a square end, while the triangle is pointed. The only thing that's going to fix this is to back the end of the connection off the target, probably all the way to the base of the triangle.
Thanks Randy, thats true. I expected the decoration to start where the line ends and to maybe take the decoration size into account wrt the anchor. At the moment, its hard to have a decoration with a smaller dimension than the line as in this case.
Created attachment 83198 [details] correct rendering The problem is that the line width is greater than 1. If you want the behavior in this attachment, I don't think the decoration and the connection can be drawn independently. The angle of one determines where the other stops drawing. Also, the decoration's line width must be >= the line's width. You have to do this by subclassing Polyline and drawing everything together in one place. The anchor's wouldn't need to change any. Or, you could create a new decoration interface: EndcapDecoration { /** * Takes a line sigment with a width, and shortens one end of the segment. * @param p1 the starting point, which gets modified * @param p2 the end point */ void offSetEnd(PrecisionPoint p1, PrecisionPoint p2, int width); }