diff --git a/ShareX.ScreenCaptureLib/Shapes/BaseShape.cs b/ShareX.ScreenCaptureLib/Shapes/BaseShape.cs index 896a07d64..a4f714226 100644 --- a/ShareX.ScreenCaptureLib/Shapes/BaseShape.cs +++ b/ShareX.ScreenCaptureLib/Shapes/BaseShape.cs @@ -75,8 +75,6 @@ public Point EndPosition public virtual bool IsRegionShape { get; } = false; - public virtual bool ShowResizeNodes { get; } = true; - internal ShapeManager Manager { get; set; } protected RegionCaptureOptions Options => Manager.Config; @@ -90,6 +88,11 @@ public virtual bool Intersects(Point position) return Rectangle.Contains(position); } + public virtual void ShowNodes() + { + Manager.NodesVisible = true; + } + public void Remove() { Manager.DeleteShape(this); diff --git a/ShareX.ScreenCaptureLib/Shapes/Drawing/FreehandDrawingShape.cs b/ShareX.ScreenCaptureLib/Shapes/Drawing/FreehandDrawingShape.cs index 32ac8e426..98b862697 100644 --- a/ShareX.ScreenCaptureLib/Shapes/Drawing/FreehandDrawingShape.cs +++ b/ShareX.ScreenCaptureLib/Shapes/Drawing/FreehandDrawingShape.cs @@ -34,15 +34,7 @@ public class FreehandDrawingShape : BaseDrawingShape { public override ShapeType ShapeType { get; } = ShapeType.DrawingFreehand; - public override bool ShowResizeNodes { get; } = false; - - public override bool IsValidShape - { - get - { - return points.Count > 0; - } - } + public override bool IsValidShape => points.Count > 0; public Point LastPosition { @@ -72,6 +64,10 @@ public override bool Intersects(Point position) return false; } + public override void ShowNodes() + { + } + public override void OnUpdate() { if (Manager.IsCreating) diff --git a/ShareX.ScreenCaptureLib/Shapes/Drawing/ImageDrawingShape.cs b/ShareX.ScreenCaptureLib/Shapes/Drawing/ImageDrawingShape.cs index 6d116fa81..0c57f2295 100644 --- a/ShareX.ScreenCaptureLib/Shapes/Drawing/ImageDrawingShape.cs +++ b/ShareX.ScreenCaptureLib/Shapes/Drawing/ImageDrawingShape.cs @@ -97,7 +97,7 @@ public override void OnCreating() } else { - Manager.NodesVisible = true; + ShowNodes(); } } diff --git a/ShareX.ScreenCaptureLib/Shapes/Drawing/StepDrawingShape.cs b/ShareX.ScreenCaptureLib/Shapes/Drawing/StepDrawingShape.cs index 2080248af..f8f1785e2 100644 --- a/ShareX.ScreenCaptureLib/Shapes/Drawing/StepDrawingShape.cs +++ b/ShareX.ScreenCaptureLib/Shapes/Drawing/StepDrawingShape.cs @@ -36,8 +36,6 @@ public class StepDrawingShape : BaseDrawingShape public override ShapeType ShapeType { get; } = ShapeType.DrawingStep; - public override bool ShowResizeNodes { get; } = false; - public int Number { get; set; } public StepDrawingShape() @@ -45,6 +43,10 @@ public StepDrawingShape() Rectangle = new Rectangle(0, 0, DefaultSize, DefaultSize); } + public override void ShowNodes() + { + } + public override void OnCreating() { Manager.IsMoving = true; diff --git a/ShareX.ScreenCaptureLib/Shapes/Drawing/TextDrawingShape.cs b/ShareX.ScreenCaptureLib/Shapes/Drawing/TextDrawingShape.cs index c4b5c42db..8b067aa6e 100644 --- a/ShareX.ScreenCaptureLib/Shapes/Drawing/TextDrawingShape.cs +++ b/ShareX.ScreenCaptureLib/Shapes/Drawing/TextDrawingShape.cs @@ -82,8 +82,7 @@ public override void OnCreating() else { AutoSize(true); - - Manager.NodesVisible = true; + ShowNodes(); } } diff --git a/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs b/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs index b2395c5e4..3ed2a44e0 100644 --- a/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs +++ b/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs @@ -1493,14 +1493,17 @@ public Image RenderOutputImage(Image img) return bmp; } + private void SelectShape(BaseShape shape) + { + if (shape != null) + { + shape.ShowNodes(); + } + } + private void SelectCurrentShape() { - BaseShape shape = CurrentShape; - - if (shape != null && shape.ShowResizeNodes && !CurrentRectangle.IsEmpty) - { - NodesVisible = true; - } + SelectShape(CurrentShape); } private void SelectIntersectShape() @@ -1510,7 +1513,7 @@ private void SelectIntersectShape() if (shape != null) { CurrentShape = shape; - SelectCurrentShape(); + SelectShape(shape); } }