From fd5bdaa9eabd894f18709c6c20f6a8d0a88e46ba Mon Sep 17 00:00:00 2001 From: Jaex Date: Fri, 1 Dec 2017 09:33:08 +0300 Subject: [PATCH] fixed #2963: Make sure to set initial size on shape paste so proportional resizing can work --- ShareX.ScreenCaptureLib/Shapes/BaseShape.cs | 2 +- ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ShareX.ScreenCaptureLib/Shapes/BaseShape.cs b/ShareX.ScreenCaptureLib/Shapes/BaseShape.cs index f19cf6fe3..cabedc26e 100644 --- a/ShareX.ScreenCaptureLib/Shapes/BaseShape.cs +++ b/ShareX.ScreenCaptureLib/Shapes/BaseShape.cs @@ -316,7 +316,7 @@ public virtual void OnNodeUpdate() StartPosition = startPos; EndPosition = endPos; - if (Manager.IsProportionalResizing) + if (Manager.IsProportionalResizing && !InitialSize.IsEmpty) { switch (nodePosition) { diff --git a/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs b/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs index f673939af..6d5c72dc9 100644 --- a/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs +++ b/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs @@ -757,7 +757,6 @@ private void EndRegionSelection() if (wasCreating) { shape.OnCreated(); - shape.InitialSize = shape.Rectangle.Size; OnShapeCreated(shape); } @@ -1313,6 +1312,7 @@ private void PasteFromClipboard() Point pos = InputManager.ClientMousePosition; shape.Rectangle = new Rectangle(pos.X, pos.Y, 1, 1); shape.SetImage(img, true); + shape.OnCreated(); AddShape(shape); SelectCurrentShape(); } @@ -1329,6 +1329,7 @@ private void PasteFromClipboard() shape.Rectangle = new Rectangle(pos.X, pos.Y, 1, 1); shape.Text = text.Trim(); shape.AutoSize(true); + shape.OnCreated(); AddShape(shape); SelectCurrentShape(); }