mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-17 09:29:30 +08:00
Fix for calculating new window size
This commit is contained in:
parent
b81101414f
commit
5aeb68acb7
@ -903,10 +903,11 @@ void setMinMaxSize(struct Application *app)
|
|||||||
// Calculate if window needs resizing
|
// Calculate if window needs resizing
|
||||||
int newWidth = app->width;
|
int newWidth = app->width;
|
||||||
int newHeight = app->height;
|
int newHeight = app->height;
|
||||||
if (app->width > app->maxWidth) newWidth = app->maxWidth;
|
|
||||||
if (app->width < app->minWidth) newWidth = app->minWidth;
|
if (app->maxWidth > 0 && app->width > app->maxWidth) newWidth = app->maxWidth;
|
||||||
if (app->height > app->maxHeight ) newHeight = app->maxHeight;
|
if (app->minWidth > 0 && app->width < app->minWidth) newWidth = app->minWidth;
|
||||||
if (app->height < app->minHeight ) newHeight = app->minHeight;
|
if (app->maxHeight > 0 && app->height > app->maxHeight ) newHeight = app->maxHeight;
|
||||||
|
if (app->minHeight > 0 && app->height < app->minHeight ) newHeight = app->minHeight;
|
||||||
|
|
||||||
// If we have any change, resize window
|
// If we have any change, resize window
|
||||||
if ( newWidth != app->width || newHeight != app->height ) {
|
if ( newWidth != app->width || newHeight != app->height ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user