Lock aspect ratio in standalone application

Xenakis's icon

Hey all,

Is there a way to lock aspect ratio of your standalone application? I've figured out how to resize and maintain the aspect ratio, but essentially I want the application to act as if the user were holding SHIFT when resizing the window, because if not, you see all the empty space around your patcher.

Any ideas?

riotchild's icon

You could use getsize I think it is, sent to thispatcher then do some math on the window width to generate the height then send this back to thispatcher, but I’m not sure what you would use to trigger getsize. I‘m guessing you want the resizing of the window to trigger the whole process, or use a metro as suggested here https://cycling74.com/forums/get-size-of-this-bpatcher