Is there any way to resize nativeWindow with aspect ratio (proportional) that works on Windows and Mac?
This solution by sydd works ok (tested on Windows) only for edges but not for corners:
http://stackoverflow.com/questions/5239691/air-resizing-native-window- proportionately
private function windowResizeEventHandler(evt:NativeWindowBoundsEvent):void
{
evt.preventDefault()
if (evt.beforeBounds.width != evt.afterBounds.width){//user resizes width
evt.currentTarget.width = evt.afterBounds.width
evt.currentTarget.height = evt.afterBounds.width/ASPECT_RATIO;
} else if (evt.beforeBounds.height != evt.afterBounds.height){
evt.currentTarget.height = evt.afterBounds.height
evt.currentTarget.width = evt.afterBounds.height*ASPECT_RATIO;
}
}
When you resize from bottom right corner, you got flickering. Resizing from other corners is wrong.
How to solve this?
Is there an option to detect from which corner/edge resizing started? So I can manually set proper bounds.
Problem is that I can't detect from which side or corner resize started in all possible situations.
event.stageX and event.stageY are detected only within stage, so if I use event.stageX and event.stageY I could start resizing from wrong side/corner. How? Well, user can move mouse out of stage lets say on tops side, and move it around NativeWindow to bottom left corner and start resize from there (event.X and event.Y are still the same), and I would detect it as resize started from top nativeWindow border. Maybe I am wrong here?
North America
Europe, Middle East and Africa
Asia Pacific