Bug 525777 - InfiniteCanvas content bounds computation should be split for better extensibility.
Summary: InfiniteCanvas content bounds computation should be split for better extensib...
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF FX (show other bugs)
Version: 5.0.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Hannes Niederhausen CLA
QA Contact:
URL:
Whiteboard: low-hanging fruit
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-09 13:18 EDT by Matthias Wienand CLA
Modified: 2018-11-02 09:10 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Wienand CLA 2017-10-09 13:18:31 EDT
The computation of content-bounds within InfiniteCanvas can be overwritten by subclasses, however, an adjustment is not correctly transferred to the computation of scrollable-bounds, which reuses the content-bounds, but additionally takes into account the bounds-in-parent of the content-group. Therefore, the computation of scrollable-bounds does also need to be overwritten when overwriting the computation of content-bounds, at least in most cases.

In order to enhance the extensibility of InfiniteCanvas, the computeContentBoundsInLocal() method should be split into a computeContentBoundsInScrolledPane() method and a computeContentBoundsInLocal() method that reuses the content-bounds-in-scrolled. The computation of scrollable-bounds can then reuse both, the content-bounds-in-scrolled, as well as the content-bounds-in-local. Then, an adjustment to the content-bounds can be made by overwriting computeContentBoundsInScrolledPane(), and it will automatically be respected by the scrollable-bounds (once recomputed).