DEADSOFTWARE

FlexUI: don't change window size in "fit to screen" mode if size was already set
authorKetmar Dark <ketmar@ketmar.no-ip.org>
Sat, 30 Sep 2017 22:18:08 +0000 (01:18 +0300)
committerKetmar Dark <ketmar@ketmar.no-ip.org>
Mon, 2 Oct 2017 23:34:41 +0000 (02:34 +0300)
src/gx/gh_ui.pas

index ff284475e98fc1b2f30eab4a002c3fb736347c9b..16281c60fdafad7e6636434336cc8f0283b6254d 100644 (file)
@@ -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;