Limit stack aspect ratio
Posted: Mon Sep 17, 2018 10:17 am
I'm trying to figure out how to place limits on the aspect ratio of a stack, when the user resizes it. I'd like it to be limited to something between 4:3 and 16:9. I'd like it to accomplish this by reducing the height or the width in order to stay within the limits.
I've tried all sorts of stuff in the resizeStack handler. The thing that comes closest to working is to set the height or width, if the ratio is out of range. But if I maximize the window on a screen that has an 8:5 aspect ratio, which is within the limits, it ends up smaller than the screen in both dimensions, no matter what dimensions the window has before maximizing it. Also, I'd expect doing that to recursively call resizeStack, but it doesn't seem to.
I've also called revChangeWindowSize inside resizeStack, but that does ugly stuff. And I've tried dynamically manipulating maxHeight and maxWidth.
Is there any other way to do this?
I've tried all sorts of stuff in the resizeStack handler. The thing that comes closest to working is to set the height or width, if the ratio is out of range. But if I maximize the window on a screen that has an 8:5 aspect ratio, which is within the limits, it ends up smaller than the screen in both dimensions, no matter what dimensions the window has before maximizing it. Also, I'd expect doing that to recursively call resizeStack, but it doesn't seem to.
I've also called revChangeWindowSize inside resizeStack, but that does ugly stuff. And I've tried dynamically manipulating maxHeight and maxWidth.
Is there any other way to do this?