From 70d959da89f2c97684017add392db10cd77ea228 Mon Sep 17 00:00:00 2001 From: Jaex Date: Sat, 11 Jun 2016 12:48:58 +0300 Subject: [PATCH] Added shape move support when creating (hold ctrl when dragging region) --- ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs b/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs index fd090d3df..f6f3c042b 100644 --- a/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs +++ b/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs @@ -168,6 +168,7 @@ public bool IsResizing } public bool IsProportionalResizing { get; private set; } + public bool IsCornerMoving { get; private set; } public bool IsSnapResizing { get; private set; } public List Windows { get; set; } @@ -890,6 +891,9 @@ private void form_KeyDown(object sender, KeyEventArgs e) case Keys.ShiftKey: IsProportionalResizing = true; break; + case Keys.ControlKey: + IsCornerMoving = true; + break; case Keys.Menu: IsSnapResizing = true; break; @@ -940,6 +944,9 @@ private void form_KeyUp(object sender, KeyEventArgs e) case Keys.ShiftKey: IsProportionalResizing = false; break; + case Keys.ControlKey: + IsCornerMoving = false; + break; case Keys.Menu: IsSnapResizing = false; break; @@ -981,8 +988,12 @@ public void Update() newPosition = CaptureHelpers.SnapPositionToDegree(PositionOnClick, CurrentPosition, 45, 0); } } - - if (IsSnapResizing) + else if (IsCornerMoving) + { + PositionOnClick = PositionOnClick.Add(InputManager.MouseVelocity.X, InputManager.MouseVelocity.Y); + shape.StartPosition = PositionOnClick; + } + else if (IsSnapResizing) { newPosition = SnapPosition(PositionOnClick, newPosition); }