Added ShowNodes property so shape can disable nodes

This commit is contained in:
Jaex 2016-08-05 16:48:46 +03:00
parent 5829085cb6
commit 05490a90e5
3 changed files with 5 additions and 2 deletions

View file

@ -88,6 +88,8 @@ public virtual bool IsValidShape
}
}
public virtual bool ShowNodes { get; } = true;
internal ShapeManager Manager { get; set; }
private Rectangle tempNodeRect;

View file

@ -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; }

View file

@ -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))
{