"fix" for a screen scaling problem I had after resizing to odd width number values
authorsheepluva
Fri, 09 Sep 2011 03:04:15 +0200
changeset 5816 ceb522b0f7d5
parent 5815 d9b50fef5164
child 5818 d071162d550d
child 5822 2af237f1fd54
"fix" for a screen scaling problem I had after resizing to odd width number values
hedgewars/hwengine.pas
--- a/hedgewars/hwengine.pas	Fri Sep 09 01:25:21 2011 +0200
+++ b/hedgewars/hwengine.pas	Fri Sep 09 03:04:15 2011 +0200
@@ -180,9 +180,12 @@
                             onFocusStateChanged()
                         end;
                 SDL_VIDEORESIZE: begin
-                    // using lower values causes widget overlap and video issues
-                    cNewScreenWidth:= max(event.resize.w, cMinScreenWidth);
-                    cNewScreenHeight:= max(event.resize.h, cMinScreenHeight);
+                    // using lower values than cMinScreenWidth or cMinScreenHeight causes widget overlap and off-screen widget parts
+                    // Change by sheepluva:
+                    // Let's only use even numbers for custom width/height since I ran into scaling issues with odd width values.
+                    // Maybe just fixes the symptom not the actual cause(?), I'm too tired to find out :P
+                    cNewScreenWidth:= max(2 * (event.resize.w div 2), cMinScreenWidth);
+                    cNewScreenHeight:= max(2 * (event.resize.h div 2), cMinScreenHeight);
                     cScreenResizeDelay:= RealTicks+500;
                     end;
 {$ENDIF}