hedgewars/uWorld.pas
branchhedgeroid
changeset 5375 ec4006837feb
parent 5341 479b4108789a
parent 5302 eaa445230124
child 5399 cdef954f8aec
--- a/hedgewars/uWorld.pas	Tue Jun 28 17:56:25 2011 +0200
+++ b/hedgewars/uWorld.pas	Tue Jun 28 17:57:54 2011 +0200
@@ -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