How to restrict resizing of electron app to a certain aspect ratio and minimum size?


#1

Hi, I want to restrict Electron Desktop app so that the user can only resize diagonally from the full screen to a certain minimum size. How can I accomplish it?


#2

You can always set a minimum size. Preserving the aspect ratio seems to be a Mac-only function, but you can easily have your app snap back to the fullscreen ratio when only one of its axes are changed.


#3

Preserving the aspect ratio works fine for my purpose.
For minimum size of the window, I just make it the same as initial window size so that the user cannot make it smaller than what they first see.

Thank you!