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

Bug 177528

Summary: Wrong size calculation in ScalableLayeredPane when scaling
Product: [Tools] GEF Reporter: Florian Thienel <florian>
Component: GEF-Legacy Draw2dAssignee: gef-inbox <gef-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Florian Thienel CLA 2007-03-15 06:51:27 EDT
Build ID: M20070212-1330

Steps To Reproduce:
1. call ScaleableLayeredPane.setScale() with a scale > 1.0d
2. call ScaleableLayeredPane.getPreferredSize()

The preferred size gets smaller, not bigger. The same with minimum size and maximum size.

More information:
The method getPreferredSize(int, int) divides by the scale and does not multiply by the scale:
Dimension d = super.getPreferredSize((int) (wHint / getScale()), (int)(hHint / getScale()));

should be:
Dimension d = super.getPreferredSize((int) (wHint * getScale()), (int)(hHint * getScale()));

The same with getMinimumSize(int, int) and getMaximumSize(int, int)
Comment 1 Randy Hudson CLA 2007-03-15 11:50:39 EDT
It is only dividing the hints by the scale, which seems to make sense to me.
Comment 2 Florian Thienel CLA 2007-03-19 04:41:45 EDT
Hm. I did some further investigation and think the calculation is not the problem. So please forget this bug... Sorry