Proportional / fixed aspect ratio window scaling with frame.setResizable
in
Programming Questions
•
5 months ago
Hello,
I cant figure it out how to make scaling of the application or run window scalable with fixed proportions
I tried this (for 3:2):
- frame.setResizable(true);
- if ((width > height + (height/2)) || (width < height + (height/2))) {
- frame.setSize(width, width - (width/3) );
- frame.setResizable(false);
- }
The first one allows u to scale only once and than the scale arrows in corner are refreshing all the time.
The second version makes a glitchy blinking effect when scaling and doesn't scale properly.
Both versions allow the scaling process to scale in the un-proportional way and than it jumps to the right size when u release mouse.
Is there any command for this like: frame.setProportions or something?
Dan
1