Bug 363562

Summary: Freeform bounds and scroll bars not correct calculated if figure has negative coordinates
Product: [Tools] GEF Reporter: bugs
Component: GEF-Legacy Draw2dAssignee: gef-inbox <gef-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Attachments:
Description Flags
Problem visualization none

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