From 4b0a323c9cb369eb7eef82b8c1602e12bf72e5e7 Mon Sep 17 00:00:00 2001 From: Jaex Date: Mon, 15 Aug 2016 03:55:44 +0300 Subject: [PATCH] Allow moving freehand drawing --- .../Shapes/Drawing/FreehandDrawingShape.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ShareX.ScreenCaptureLib/Shapes/Drawing/FreehandDrawingShape.cs b/ShareX.ScreenCaptureLib/Shapes/Drawing/FreehandDrawingShape.cs index 02e240559..ce7d17842 100644 --- a/ShareX.ScreenCaptureLib/Shapes/Drawing/FreehandDrawingShape.cs +++ b/ShareX.ScreenCaptureLib/Shapes/Drawing/FreehandDrawingShape.cs @@ -122,5 +122,20 @@ public override void OnDraw(Graphics g) g.SmoothingMode = SmoothingMode.None; } } + + public override void Move(int x, int y) + { + for (int i = 0; i < points.Count; i++) + { + points[i] = points[i].Add(x, y); + } + + Rectangle = Rectangle.LocationOffset(x, y); + } + + public override void Resize(int x, int y, bool fromBottomRight) + { + Move(x, y); + } } } \ No newline at end of file