mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-07 07:26:05 +12:00
Added ShowNodes virtual function to BaseShape instead of using ShowResizeNodes property
This commit is contained in:
parent
5b7cd4063d
commit
25460cb4b9
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -97,7 +97,7 @@ public override void OnCreating()
|
|||
}
|
||||
else
|
||||
{
|
||||
Manager.NodesVisible = true;
|
||||
ShowNodes();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -82,8 +82,7 @@ public override void OnCreating()
|
|||
else
|
||||
{
|
||||
AutoSize(true);
|
||||
|
||||
Manager.NodesVisible = true;
|
||||
ShowNodes();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue