Fix camera jerking on zoom in
authorunc0rr
Sat, 25 Jun 2011 16:39:54 +0400
changeset 5302 eaa445230124
parent 5300 3d1a27042dda
child 5305 370989a1ddf0
Fix camera jerking on zoom in
hedgewars/uWorld.pas
--- a/hedgewars/uWorld.pas	Fri Jun 24 14:40:44 2011 -0400
+++ b/hedgewars/uWorld.pas	Sat Jun 25 16:39:54 2011 +0400
@@ -1227,14 +1227,14 @@
             CursorPoint.X:= cScreenWidth div 2 - EdgesDist
         end;
 
-    shs:= cScreenHeight div 2 - trunc(cScreenHeight / cScaleFactor) + EdgesDist;
+    shs:= min(cScreenHeight div 2 - trunc(cScreenHeight / cScaleFactor) + EdgesDist, cScreenHeight - EdgesDist);
     if CursorPoint.Y < shs then
     begin
         WorldDy:= WorldDy + CursorPoint.Y - shs;
         CursorPoint.Y:= shs;
     end
     else
-        if CursorPoint.Y > cScreenHeight - EdgesDist then
+        if (CursorPoint.Y > cScreenHeight - EdgesDist) then
         begin
            WorldDy:= WorldDy + CursorPoint.Y - cScreenHeight + EdgesDist;
            CursorPoint.Y:= cScreenHeight - EdgesDist