Bug 363562 - Freeform bounds and scroll bars not correct calculated if figure has negative coordinates
Summary: Freeform bounds and scroll bars not correct calculated if figure has negative...
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy Draw2d (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-11 04:38 EST by bugs CLA
Modified: 2011-11-11 04:39 EST (History)
0 users

See Also:


Attachments
Problem visualization (13.73 KB, image/png)
2011-11-11 04:39 EST, bugs CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description bugs CLA 2011-11-11 04:38:48 EST
Build Identifier: org.eclipse.draw2d_3.6.2.v20110128-0100.jar

I have an application which uses the FreeformViewport via ScalableFreeformRootEditPart. If a figure is shown which has mostly negative coordinates an empty space is shown below or beside the figure. Also the scroll bars are incorrect displayed: even if the figure has the same size as the view port the scroll bars shows addition space and therefore allows scrolling.
I investigate the problem and found the possible cause: The new bounds might be calculated wrong in FreeformViewport.readjustScrollBars(). The bounds from the FreeformFigure and the client area are combined by an union operator reference the point 0/0 and the client's width and height, but the client's x/y should be used as reference. I could fix the problem by changing the union with "bounds.union(clientArea);"
I attached a drawing which visualize the problem.

Reproducible: Always

Steps to Reproduce:
1. Create an editor with a SclableFreeformRootEditPart
2. Place a figure with negative coordinates on the layer
3. Zoom to fit the figure on the page
4. check the scroll bars and its extend
Comment 1 bugs CLA 2011-11-11 04:39:43 EST
Created attachment 206831 [details]
Problem visualization