Bug 193407 - PolylineConnection with PolygonDecoration - line extends past triangle tip
Summary: PolylineConnection with PolygonDecoration - line extends past triangle tip
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy Draw2d (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows Vista
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday
Depends on:
Blocks:
 
Reported: 2007-06-19 17:08 EDT by Adam Cabler CLA
Modified: 2007-11-18 13:43 EST (History)
2 users (show)

See Also:


Attachments
ss showing line extending pastdest decoration (6.42 KB, image/jpeg)
2007-11-16 12:27 EST, Adam Cabler CLA
no flags Details
ss2 showing lines extending past decoration (2.62 KB, image/jpeg)
2007-11-16 12:28 EST, Adam Cabler CLA
no flags Details
correct rendering (2.88 KB, image/gif)
2007-11-18 13:43 EST, Randy Hudson CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Cabler CLA 2007-06-19 17:08:50 EDT
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.
Comment 1 Anthony Hunter CLA 2007-11-16 10:18:40 EST
(In reply to comment #0)
> [snip] I can post screenshots if that would be
> helpful.
> 

Please do post some screenshots.
Comment 2 Adam Cabler CLA 2007-11-16 12:27:22 EST
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.
Comment 3 Adam Cabler CLA 2007-11-16 12:28:46 EST
Created attachment 83088 [details]
ss2 showing lines extending past decoration
Comment 4 Randy Hudson CLA 2007-11-17 15:55:45 EST
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.
Comment 5 Adam Cabler CLA 2007-11-17 16:21:51 EST
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.
Comment 6 Randy Hudson CLA 2007-11-18 13:43:26 EST
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);

}