Resize with AspectRatio


#1

I was wondering if anybody has implemented a resize where the aspect ratio of the original shape is preserved.

handleResizing in a new JGoView Subclass is the key I think

regards,
Dennis


#2

Actually, you probably want to override JGoObject.handleResize.
The code in SimpleNode.java, rescaleChildren, maintains the aspect ratio of the image when the whole node is resized. That’s not exactly what you probably want, but it’s similar.


#3

Thx, i did that already, but can you commit the rubberband(when resizing) to the same aspect ratio as well?
Dennis


#4

I believe you can–you need to customize the Rectangle returned by your override of JGoObject.handleResize.


#5

THX, I will do that