| Summary: | ViewportAwareConnectionLayerClippingStrategy: connection not rendered if anchor on right/bottom border | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Henning Heitkoetter <hheitkoetter> | ||||
| Component: | GEF-Legacy Draw2d | Assignee: | Alexander Nyßen <nyssen> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P1 | CC: | ahunter.eclipse, nyssen | ||||
| Version: | unspecified | ||||||
| Target Milestone: | 3.6.0 (Helios) RC2 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
There is an additional problem that clipping is always performed at the viewport parent's client area, independent of whether the parent has an opaque border or not. Created attachment 168984 [details]
Patch to fix both reported problems within ViewportAwareConnectionLayerClippingStrategy
Anthony, I would like to fix this in RC2. As this strategy has been newly introduced in 3.6, there is no chance of running into any regressions here. Could you please review my patch and state whether the changes are good to go. Agreed. The patch still had a minor problem, as the computation of the viewport's client area was incorrect in case of graphics translation being enabled. Fixed this as well by using the viewport's parent to calculate the area instead. Committed all changes to cvs HEAD. Having reinvestigated this, the problem was indeed not within the calculation of the viewport client area, but but was caused by an improper layouting of the viewport by a PuristicScrollPane as parent. As PuristicScrollPane was as well introduced in 3.6 and there is no fear of a regression there either, I restored the calculation of the viewport's client area within ViewportAwareConnectionLayerClippingStrategy and fixed the problem of invalid layouting within PuristicScrollPane (actually this was some sort of a hack before). Validated with logic example that clipping is now correctly working with normal as well as puristic scroll pane within circuit figure. |
Build: 3.6.0M7 Using ConnectionLayerClippingStrategy, a connection between two shapes is not rendered at all, if 1) source and target have different "nearest enclosing source and target viewports" AND 2) the source and/or target anchor are placed on the right or bottom border of a figure. This happens regardless of the visibility of source and target anchor. As I understand it, the reason lies in the following lines in getEdgeClippingRectangle: > boolean sourceAnchorVisible = > sourceClipRect.contains(absolutePointsAsCopy.getFirstPoint()); > boolean targetAnchorVisible = > targetClipRect.contains(absolutePointsAsCopy.getLastPoint()); Rectangle.contains includes the top and left border, but not the right or bottom border when checking if a point lies within the rectangle. Thus, if an anchor lies on one of these borders, the visible flag is false and an empty clipping array is returned, even though the anchor is visible.