From: Ketmar Dark Date: Sat, 30 Sep 2017 22:18:08 +0000 (+0300) Subject: FlexUI: don't change window size in "fit to screen" mode if size was already set X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=aec28fc6e387a0881d3ae6a785f6fcc0655b2473;p=d2df-sdl.git FlexUI: don't change window size in "fit to screen" mode if size was already set --- diff --git a/src/gx/gh_ui.pas b/src/gx/gh_ui.pas index ff28447..16281c6 100644 --- a/src/gx/gh_ui.pas +++ b/src/gx/gh_ui.pas @@ -2076,8 +2076,12 @@ end; procedure TUITopWindow.flFitToScreen (); +var + nsz: TLaySize; begin - flMaxSize := TLaySize.Create(trunc(gxScreenWidth/gh_ui_scale)-mFrameWidth*2-6, trunc(gxScreenHeight/gh_ui_scale)-mFrameHeight*2-6); + nsz := TLaySize.Create(trunc(gxScreenWidth/gh_ui_scale)-mFrameWidth*2-6, trunc(gxScreenHeight/gh_ui_scale)-mFrameHeight*2-6); + if (mMaxSize.w < 1) then mMaxSize.w := nsz.w; + if (mMaxSize.h < 1) then mMaxSize.h := nsz.h; end;