diff --git a/ShareX.ScreenCaptureLib/Shapes/BaseShape.cs b/ShareX.ScreenCaptureLib/Shapes/BaseShape.cs index c2b2125f6..009045b49 100644 --- a/ShareX.ScreenCaptureLib/Shapes/BaseShape.cs +++ b/ShareX.ScreenCaptureLib/Shapes/BaseShape.cs @@ -136,7 +136,7 @@ public virtual void OnUpdate() { if (Manager.IsCreating && !Rectangle.IsEmpty) { - Point currentPosition = InputManager.MousePosition0Based; + Point pos = InputManager.MousePosition0Based; if (Manager.IsCornerMoving) { @@ -146,19 +146,19 @@ public virtual void OnUpdate() { if (NodeType == NodeType.Rectangle) { - currentPosition = CaptureHelpers.SnapPositionToDegree(StartPosition, currentPosition, 90, 45); + pos = CaptureHelpers.SnapPositionToDegree(StartPosition, pos, 90, 45); } else if (NodeType == NodeType.Line) { - currentPosition = CaptureHelpers.SnapPositionToDegree(StartPosition, currentPosition, 45, 0); + pos = CaptureHelpers.SnapPositionToDegree(StartPosition, pos, 45, 0); } } else if (Manager.IsSnapResizing) { - currentPosition = Manager.SnapPosition(StartPosition, currentPosition); + pos = Manager.SnapPosition(StartPosition, pos); } - EndPosition = currentPosition; + EndPosition = pos; } else if (Manager.IsMoving) { diff --git a/ShareX.ScreenCaptureLib/Shapes/Region/FreehandRegionShape.cs b/ShareX.ScreenCaptureLib/Shapes/Region/FreehandRegionShape.cs index e80f31790..18d43b79a 100644 --- a/ShareX.ScreenCaptureLib/Shapes/Region/FreehandRegionShape.cs +++ b/ShareX.ScreenCaptureLib/Shapes/Region/FreehandRegionShape.cs @@ -42,24 +42,31 @@ public override void OnUpdate() { if (Manager.IsCreating) { - Point pos = InputManager.MousePosition0Based; - - if (points.Count == 0 || (!Manager.IsProportionalResizing && points[points.Count - 1] != pos)) + if (Manager.IsCornerMoving) { - points.Add(pos); + Move(InputManager.MouseVelocity); } - - if (Manager.IsProportionalResizing) + else { - if (!isPolygonMode) + Point pos = InputManager.MousePosition0Based; + + if (points.Count == 0 || (!Manager.IsProportionalResizing && points[points.Count - 1] != pos)) { points.Add(pos); } - points[points.Count - 1] = pos; - } + if (Manager.IsProportionalResizing) + { + if (!isPolygonMode) + { + points.Add(pos); + } - isPolygonMode = Manager.IsProportionalResizing; + points[points.Count - 1] = pos; + } + + isPolygonMode = Manager.IsProportionalResizing; + } Rectangle = points.CreateRectangle(); }