Bug 160744 - ScalableFigure and ScaledGraphics should be enhanced to support different scaling factors for x and y axis
Summary: ScalableFigure and ScaledGraphics should be enhanced to support different sca...
Status: RESOLVED WONTFIX
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy Draw2d (show other bugs)
Version: 3.2   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 142444
  Show dependency tree
 
Reported: 2006-10-12 16:19 EDT by E F CLA
Modified: 2014-08-28 12:28 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description E F CLA 2006-10-12 16:19:13 EDT
ScalableFigure provides a mechanism to scale a figure using the 
  "setScale(double scale);" method; 
however, this provides uniform scaling only.  
could we possibly also have something like:
  "setScale(double xScale, double yScale);" method; 
which allows for non-uniform scaling and also propagates to the ZoomManager?

Thanks,
Elias.
Comment 1 Ian Bull CLA 2006-12-18 23:01:33 EST
I wrote my own XYScaledGraphics that allows you to scale the X and Y independently.  I posted this a while ago (https://bugs.eclipse.org/bugs/show_bug.cgi?id=129471), but GEF was in API freeze, and it was suggested that GEF will move towards SWT's transformation, which does support this.

If you want, I can post my XYScaledGraphics.
Comment 2 E F CLA 2006-12-19 11:45:22 EST
Certainly, please do - thanks!

For our problem, we needed to scale along the x-axis only.  So what we did was create a layout manager that expands figures in the x direction when the canvas is resized.  We took care of the labels separately, in order for them not to be scaled, by translating them to their proper location.

E.
Comment 3 Alexander Nyßen CLA 2011-02-02 18:04:31 EST
It would be nice if we could generalize ScalableFigure this way. However, the getScale() method, which is included in the ScalableFigure interface does not make sense in such a context and would need to be removed, which is not possible without breaking API.

Things are similarly for ScaledGraphics. It would make sense to implement scale(float, float) from Graphics here as well (which would make the XYScaledGraphics from Zest obsolete, so we would remove it and share the same ScaledGraphics implementation). However, here, Graphics offers getAbsoluteScale(), which does not make sense in such a scenario either. As such, breaking API is required here as well. 

Updated summary, changed milestone to FUTURE, which shall indicate that this is something that should be included in a 4.0 release.
Comment 4 Alexander Nyßen CLA 2014-08-28 12:28:05 EDT
As Draw2d is now only maintained (and we are not planning to break its existing API), resolving this as WONTFIX.