Disable resize nodes for freehand region

This commit is contained in:
Jaex 2016-08-03 11:45:12 +03:00
parent 9d64eb6bb5
commit b367bcb747
4 changed files with 9 additions and 7 deletions

View file

@ -57,7 +57,8 @@ public enum NodeType
None,
Rectangle,
Line,
Point
Point,
CustomNoResize
}
internal enum NodePosition

View file

@ -112,11 +112,7 @@ public virtual void OnCreated()
public virtual void OnUpdate()
{
if (Manager.IsMoving)
{
Manager.ResizeManager.MoveCurrentArea(InputManager.MouseVelocity.X, InputManager.MouseVelocity.Y);
}
else if (Manager.IsCreating && !Rectangle.IsEmpty)
if (Manager.IsCreating && !Rectangle.IsEmpty)
{
Point currentPosition = InputManager.MousePosition0Based;
@ -142,6 +138,10 @@ public virtual void OnUpdate()
EndPosition = currentPosition;
}
else if (Manager.IsMoving)
{
Manager.ResizeManager.MoveCurrentArea(InputManager.MouseVelocity.X, InputManager.MouseVelocity.Y);
}
}
public virtual void OnShapePathRequested(GraphicsPath gp, Rectangle rect)

View file

@ -34,6 +34,7 @@ namespace ShareX.ScreenCaptureLib
public class FreehandRegionShape : BaseRegionShape
{
public override ShapeType ShapeType { get; } = ShapeType.RegionFreehand;
public override NodeType NodeType { get; } = NodeType.CustomNoResize;
private List<Point> points = new List<Point>(128);

View file

@ -1392,7 +1392,7 @@ private void SelectShape()
{
BaseShape shape = CurrentShape;
if (shape != null && !CurrentRectangle.IsEmpty && shape.NodeType != NodeType.Point)
if (shape != null && !CurrentRectangle.IsEmpty && shape.NodeType != NodeType.Point && shape.NodeType != NodeType.CustomNoResize)
{
ResizeManager.Show();
}