From 05490a90e57db6e2c974ff3510a28047c21242f1 Mon Sep 17 00:00:00 2001 From: Jaex Date: Fri, 5 Aug 2016 16:48:46 +0300 Subject: [PATCH] Added ShowNodes property so shape can disable nodes --- ShareX.ScreenCaptureLib/Shapes/BaseShape.cs | 2 ++ ShareX.ScreenCaptureLib/Shapes/Drawing/StepDrawingShape.cs | 1 + ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ShareX.ScreenCaptureLib/Shapes/BaseShape.cs b/ShareX.ScreenCaptureLib/Shapes/BaseShape.cs index 147db2da0..4623fb5d4 100644 --- a/ShareX.ScreenCaptureLib/Shapes/BaseShape.cs +++ b/ShareX.ScreenCaptureLib/Shapes/BaseShape.cs @@ -88,6 +88,8 @@ public virtual bool IsValidShape } } + public virtual bool ShowNodes { get; } = true; + internal ShapeManager Manager { get; set; } private Rectangle tempNodeRect; diff --git a/ShareX.ScreenCaptureLib/Shapes/Drawing/StepDrawingShape.cs b/ShareX.ScreenCaptureLib/Shapes/Drawing/StepDrawingShape.cs index 018a41f4f..89a4c45b8 100644 --- a/ShareX.ScreenCaptureLib/Shapes/Drawing/StepDrawingShape.cs +++ b/ShareX.ScreenCaptureLib/Shapes/Drawing/StepDrawingShape.cs @@ -36,6 +36,7 @@ public class StepDrawingShape : BaseDrawingShape public override ShapeType ShapeType { get; } = ShapeType.DrawingStep; public override NodeType NodeType { get; } = NodeType.Point; + public override bool ShowNodes { get; } = false; public int Number { get; set; } diff --git a/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs b/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs index 02db6858c..65a18bd26 100644 --- a/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs +++ b/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs @@ -1517,7 +1517,7 @@ private void SelectShape() { BaseShape shape = CurrentShape; - if (shape != null && !CurrentRectangle.IsEmpty && shape.NodeType != NodeType.Point) + if (shape != null && shape.ShowNodes && !CurrentRectangle.IsEmpty) { NodesVisible = true; } @@ -1586,7 +1586,7 @@ private void UpdateNodes() { BaseShape shape = CurrentShape; - if (shape != null && NodesVisible && Nodes != null) + if (shape != null && NodesVisible) { if (InputManager.IsMouseDown(MouseButtons.Left)) {