summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fe7bb30)
raw | patch | inline | side by side (parent: fe7bb30)
author | binarymaster <x86corez@gmail.com> | |
Sat, 30 Sep 2017 19:18:54 +0000 (22:18 +0300) | ||
committer | binarymaster <x86corez@gmail.com> | |
Sat, 30 Sep 2017 19:18:54 +0000 (22:18 +0300) |
src/editor/f_main.pas | patch | blob | history |
diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas
index 82bd18dec1de2ee47bb2044fb12b491f2c8e6527..e0054350131bc2507ed9cfc4c8a963fce0ebe835 100644 (file)
--- a/src/editor/f_main.pas
+++ b/src/editor/f_main.pas
public
procedure RefreshRecentMenu();
procedure OpenMapFile(FileName: String);
+ function RenderMousePos(): TPoint;
end;
const
Draw();
end;
+function TMainForm.RenderMousePos(): Types.TPoint;
+begin
+ Result := RenderPanel.ScreenToClient(Mouse.CursorPos);
+end;
+
procedure TMainForm.RenderPanelMouseMove(Sender: TObject;
Shift: TShiftState; X, Y: Integer);
var
if (MouseLDown or MouseRDown) and (Position >= DotStep) then
begin
Dec(WASDOffset.Y, DotStep);
- RenderPanelMouseMove(Sender, Shift, LastMovePoint.X, LastMovePoint.Y);
+ RenderPanelMouseMove(Sender, Shift, RenderMousePos().X, RenderMousePos().Y);
end;
Position := IfThen(Position > DotStep, Position-DotStep, 0);
MapOffset.Y := -Round(Position/16) * 16;
if (MouseLDown or MouseRDown) and (Position+DotStep <= Max) then
begin
Inc(WASDOffset.Y, DotStep);
- RenderPanelMouseMove(Sender, Shift, LastMovePoint.X, LastMovePoint.Y);
+ RenderPanelMouseMove(Sender, Shift, RenderMousePos().X, RenderMousePos().Y);
end;
Position := IfThen(Position+DotStep < Max, Position+DotStep, Max);
MapOffset.Y := -Round(Position/16) * 16;
if (MouseLDown or MouseRDown) and (Position >= DotStep) then
begin
Dec(WASDOffset.X, DotStep);
- RenderPanelMouseMove(Sender, Shift, LastMovePoint.X, LastMovePoint.Y);
+ RenderPanelMouseMove(Sender, Shift, RenderMousePos().X, RenderMousePos().Y);
end;
Position := IfThen(Position > DotStep, Position-DotStep, 0);
MapOffset.X := -Round(Position/16) * 16;
if (MouseLDown or MouseRDown) and (Position+DotStep <= Max) then
begin
Inc(WASDOffset.X, DotStep);
- RenderPanelMouseMove(Sender, Shift, LastMovePoint.X, LastMovePoint.Y);
+ RenderPanelMouseMove(Sender, Shift, RenderMousePos().X, RenderMousePos().Y);
end;
Position := IfThen(Position+DotStep < Max, Position+DotStep, Max);
MapOffset.X := -Round(Position/16) * 16;