hedgewars/uCursor.pas
branchwebgl
changeset 8444 75db7bb8dce8
parent 8330 aaefa587e277
parent 8346 3443e0de2c9d
child 10015 4feced261c68
--- a/hedgewars/uCursor.pas	Wed Jan 02 11:11:49 2013 +0100
+++ b/hedgewars/uCursor.pas	Sun Jan 27 00:28:57 2013 +0100
@@ -5,6 +5,7 @@
 procedure init;
 procedure resetPosition;
 procedure updatePosition;
+procedure handlePositionUpdate(x, y: LongInt);
 
 implementation
 
@@ -40,9 +41,8 @@
 {$ENDIF}
 
     if(x <> cScreenWidth div 2) or (y <> cScreenHeight div 2) then
-        begin
-        CursorPoint.X:= CursorPoint.X + x - cScreenWidth div 2;
-        CursorPoint.Y:= CursorPoint.Y - y + cScreenHeight div 2;
+    begin
+        handlePositionUpdate(x - cScreenWidth div 2, y - cScreenHeight div 2);
 
         if cHasFocus then
             begin
@@ -56,4 +56,10 @@
         end
 end;
 
+procedure handlePositionUpdate(x, y: LongInt);
+begin
+    CursorPoint.X:= CursorPoint.X + x;
+    CursorPoint.Y:= CursorPoint.Y - y;
+end;
+
 end.