When shift pressed create new point once to move for polygon mode

This commit is contained in:
Jaex 2016-08-04 13:19:42 +03:00
parent 1315f47340
commit 3b2d2d3045

View file

@ -37,6 +37,7 @@ public class FreehandRegionShape : BaseRegionShape
public override NodeType NodeType { get; } = NodeType.CustomNoResize;
private List<Point> points = new List<Point>();
private bool isPolygonMode;
public override void OnUpdate()
{
@ -50,9 +51,16 @@ public override void OnUpdate()
}
else if (Manager.IsProportionalResizing)
{
points[points.Count - 1] = InputManager.MousePosition0Based;
if (!isPolygonMode)
{
points.Add(pos);
}
points[points.Count - 1] = pos;
}
isPolygonMode = Manager.IsProportionalResizing;
Rectangle = points.CreateRectangle();
}
else if (Manager.IsMoving)