Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 251093

Summary: Cannot scroll GridLayout when zoomed
Product: [Tools] GEF Reporter: Mark Proe <markproe>
Component: GEF-Legacy Draw2dAssignee: Alex Boyko <aboyko>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: aboyko, ahunter.eclipse, Udo.Walker, vijay.rajonline
Version: 3.3   
Target Milestone: 3.6.0 (Helios) RC2   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Attachments:
Description Flags
patched shapes example plugin
none
The saved shapes example file to be opened in the editor
none
patch
none
patch none

Description Mark Proe CLA 2008-10-16 11:10:15 EDT
Build ID: I20070621-1340

Steps To Reproduce:
1.  Create a GraphicalEditor that uses a ScalableRootEditPart. 

2.  For the root component, create a figure that uses GridLayout.  See below...

@Override
protected IFigure createFigure() { 
   Layer figure = new Layer();
   GridLayout layout = new GridLayout(1, true);
   layout.marginWidth = 15;
   layout.marginHeight = 7;
   layout.verticalSpacing = 5;
   figure.setLayoutManager(layout);
   return figure;
}

3.  Create at least one child edit part.  You may use any simple figure such as a Label or Shape.

4.  While running the application, size the window so that the viewer doesn't fit and the scroll bars appear.

5.  Try zooming in.  The scroll bars will vanish, even though they should still be visible.


More information:
I only seem to lose my scroll bars when zooming a GridLayout.  If I use a StackLayout, everything looks fine.  However, I would really prefer to be using the additional functionality GridLayout provides.
Comment 1 Udo Walker CLA 2009-07-29 04:07:02 EDT
Zooming out, e.g. 50% works fine but if you zoom in more than 100%, e.g. 150% than the scroll bars vanish.
Comment 2 Vijay Raj CLA 2010-03-26 08:38:44 EDT
Any progress on this issue ???

at least a comment whether this issue will be fixed or not pls.
Comment 3 Alex Boyko CLA 2010-03-26 09:59:23 EDT
Can yu please attach the "hack"-patch for one of GEF example editors? 
Thus, with the "hack" patch we get the grid layout in of the example editors and can easily reproduce your problem. Thnanks.
Comment 4 Vijay Raj CLA 2010-03-27 04:43:17 EDT
Created attachment 163137 [details]
patched shapes example plugin

run it as a shapes example and open the shapesExaple1.shapes file in the editor.

try zoomIn and zoomout tool bar actions
Comment 5 Vijay Raj CLA 2010-03-27 04:49:01 EDT
(In reply to comment #3)
> Can yu please attach the "hack"-patch for one of GEF example editors? 
> Thus, with the "hack" patch we get the grid layout in of the example editors
> and can easily reproduce your problem. Thnanks.

i have attached the modified shapes example plugin.

Note: I have changed ScalableFreeFormRootEditPart to ScalableRootEditPart and added zoom toolbar actions to editor.

open the shapesExaple1.shapes file in the
editor.

try zoomIn and zoomout tool bar actions

the scrollbar vanishes for zoom levels above 100 and below 100%.

also pls refer this forum discussion...

http://www.eclipse.org/forums/index.php?t=msg&th=79050&start=0&SQ=7c9b11f8fe1c0040ed16892827be9eaa&
Comment 6 Vijay Raj CLA 2010-03-27 04:51:35 EDT
Created attachment 163139 [details]
The saved shapes example file to be opened in the editor
Comment 7 Alex Boyko CLA 2010-05-15 00:46:06 EDT
Created attachment 168625 [details]
patch

This is the fix.
Turns out GridLayout was getting wHint == 0 and hHint == 0 for the preferred size instead of -1, -1. -1 was being scaled and casted to (int), i.e. (int) (-0.67f) == 0.
Corrected the problem ScalableLayeredPane. Tested with the attached example on Win 7 x64.

Thanks a lot for the attached example! If you have any problems with the patch - let me know.
Comment 8 Alex Boyko CLA 2010-05-15 00:55:42 EDT
Created attachment 168626 [details]
patch

Updated the patch. Had to do the same thing for the preferred size too.

Please test the fix with your app. Let me know if everything looks ok.
Comment 9 Anthony Hunter CLA 2010-05-17 15:37:38 EDT
Waiting for feedback so moving to RC2.
Comment 10 Anthony Hunter CLA 2010-05-18 16:12:53 EDT
The patch seems ok.
Comment 11 Alex Boyko CLA 2010-05-18 16:25:21 EDT
I'll commit it then. Seems ok to me too.
Comment 12 Alex Boyko CLA 2010-05-18 16:38:32 EDT
Delivered for 3.6 RC2