summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 04aa8dd)
raw | patch | inline | side by side (parent: 04aa8dd)
author | binarymaster <x86corez@gmail.com> | |
Fri, 29 Sep 2017 19:59:51 +0000 (22:59 +0300) | ||
committer | binarymaster <x86corez@gmail.com> | |
Fri, 29 Sep 2017 19:59:51 +0000 (22:59 +0300) |
http://doom2d.org/forum/viewtopic.php?f=12&t=1483
src/editor/f_main.pas | patch | blob | history |
diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas
index 8158c03344f380660a7de069841ce8357aedb984..63f31f4a83d7edc3aaa77513e34b171e75e1f2e1 100644 (file)
--- a/src/editor/f_main.pas
+++ b/src/editor/f_main.pas
MouseRDown: Boolean;
MouseLDownPos: Types.TPoint;
MouseRDownPos: Types.TPoint;
+ WASDOffset: TPoint;
SelectFlag: Byte = SELECTFLAG_NONE;
MouseAction: Byte = MOUSEACTION_NONE;
if MouseAction = MOUSEACTION_MOVEOBJ then
begin
MoveSelectedObjects(ssShift in Shift, ssCtrl in Shift,
- MousePos.X-LastMovePoint.X,
- MousePos.Y-LastMovePoint.Y);
+ MousePos.X-LastMovePoint.X+WASDOffset.X,
+ MousePos.Y-LastMovePoint.Y+WASDOffset.Y);
+ WASDOffset.X := 0;
+ WASDOffset.Y := 0;
end
else
// Меняем размер выделенного объекта:
if (SelectedObjectCount = 1) and
(SelectedObjects[GetFirstSelected].Live) then
begin
- dWidth := MousePos.X-LastMovePoint.X;
- dHeight := MousePos.Y-LastMovePoint.Y;
+ dWidth := MousePos.X-LastMovePoint.X+WASDOffset.X;
+ dHeight := MousePos.Y-LastMovePoint.Y+WASDOffset.Y;
+ WASDOffset.X := 0;
+ WASDOffset.Y := 0;
case ResizeType of
RESIZETYPE_VERTICAL: dWidth := 0;
begin
if Key = Ord('W') then
begin
+ if (MouseLDown or MouseRDown) and (Position >= DotStep) then
+ begin
+ Dec(WASDOffset.Y, DotStep);
+ RenderPanelMouseMove(Sender, Shift, LastMovePoint.X, LastMovePoint.Y);
+ end;
Position := IfThen(Position > DotStep, Position-DotStep, 0);
MapOffset.Y := -Round(Position/16) * 16;
end;
if Key = Ord('S') then
begin
+ if (MouseLDown or MouseRDown) and (Position+DotStep <= Max) then
+ begin
+ Inc(WASDOffset.Y, DotStep);
+ RenderPanelMouseMove(Sender, Shift, LastMovePoint.X, LastMovePoint.Y);
+ end;
Position := IfThen(Position+DotStep < Max, Position+DotStep, Max);
MapOffset.Y := -Round(Position/16) * 16;
end;
begin
if Key = Ord('A') then
begin
+ if (MouseLDown or MouseRDown) and (Position >= DotStep) then
+ begin
+ Dec(WASDOffset.X, DotStep);
+ RenderPanelMouseMove(Sender, Shift, LastMovePoint.X, LastMovePoint.Y);
+ end;
Position := IfThen(Position > DotStep, Position-DotStep, 0);
MapOffset.X := -Round(Position/16) * 16;
end;
if Key = Ord('D') then
begin
+ if (MouseLDown or MouseRDown) and (Position+DotStep <= Max) then
+ begin
+ Inc(WASDOffset.X, DotStep);
+ RenderPanelMouseMove(Sender, Shift, LastMovePoint.X, LastMovePoint.Y);
+ end;
Position := IfThen(Position+DotStep < Max, Position+DotStep, Max);
MapOffset.X := -Round(Position/16) * 16;
end;