DEADSOFTWARE

Movement: Implement WASD selection
authorStas'M <x86corez@gmail.com>
Sat, 6 Oct 2018 14:57:38 +0000 (17:57 +0300)
committerStas'M <x86corez@gmail.com>
Sat, 6 Oct 2018 14:57:38 +0000 (17:57 +0300)
src/editor/f_main.pas

index 3f65bba33336ec96c8a80a4f7a8c0f0e268a3efa..ea7b4a9f7ed7e9e06909419ab9de7680ff8e377d 100644 (file)
@@ -4377,6 +4377,11 @@ begin
         begin
           if (MouseLDown or MouseRDown) and (Position >= DotStep) then
           begin
+            if DrawRect <> nil then
+            begin
+              Inc(MouseLDownPos.y, DotStep);
+              Inc(MouseRDownPos.y, DotStep);
+            end;
             Dec(WASDOffset.Y, DotStep);
             RenderPanelMouseMove(Sender, Shift, RenderMousePos().X, RenderMousePos().Y);
           end;
@@ -4388,6 +4393,11 @@ begin
         begin
           if (MouseLDown or MouseRDown) and (Position+DotStep <= Max) then
           begin
+            if DrawRect <> nil then
+            begin
+              Dec(MouseLDownPos.y, DotStep);
+              Dec(MouseRDownPos.y, DotStep);
+            end;
             Inc(WASDOffset.Y, DotStep);
             RenderPanelMouseMove(Sender, Shift, RenderMousePos().X, RenderMousePos().Y);
           end;
@@ -4403,6 +4413,11 @@ begin
         begin
           if (MouseLDown or MouseRDown) and (Position >= DotStep) then
           begin
+            if DrawRect <> nil then
+            begin
+              Inc(MouseLDownPos.x, DotStep);
+              Inc(MouseRDownPos.x, DotStep);
+            end;
             Dec(WASDOffset.X, DotStep);
             RenderPanelMouseMove(Sender, Shift, RenderMousePos().X, RenderMousePos().Y);
           end;
@@ -4414,6 +4429,11 @@ begin
         begin
           if (MouseLDown or MouseRDown) and (Position+DotStep <= Max) then
           begin
+            if DrawRect <> nil then
+            begin
+              Dec(MouseLDownPos.x, DotStep);
+              Dec(MouseRDownPos.x, DotStep);
+            end;
             Inc(WASDOffset.X, DotStep);
             RenderPanelMouseMove(Sender, Shift, RenderMousePos().X, RenderMousePos().Y);
           end;