mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-05 20:54:31 +13:00
Added drag move support to freehand region
This commit is contained in:
parent
664b8d1889
commit
fc01094172
1 changed files with 13 additions and 6 deletions
|
@ -48,24 +48,31 @@ public override void OnUpdate()
|
||||||
Rectangle = Rectangle.AddPoint(point);
|
Rectangle = Rectangle.AddPoint(point);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (Manager.IsMoving)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < points.Count; i++)
|
||||||
|
{
|
||||||
|
points[i] = points[i].Add(InputManager.MouseVelocity.X, InputManager.MouseVelocity.Y);
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle = Rectangle.LocationOffset(InputManager.MouseVelocity.X, InputManager.MouseVelocity.Y);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnShapePathRequested(GraphicsPath gp, Rectangle rect)
|
public override void OnShapePathRequested(GraphicsPath gp, Rectangle rect)
|
||||||
{
|
{
|
||||||
int len = points.Count;
|
if (points.Count > 1)
|
||||||
|
|
||||||
if (len > 1)
|
|
||||||
{
|
{
|
||||||
gp.StartFigure();
|
gp.StartFigure();
|
||||||
|
|
||||||
for (int i = 0; i < len - 1; i++)
|
for (int i = 0; i < points.Count - 1; i++)
|
||||||
{
|
{
|
||||||
gp.AddLine(points[i], points[i + 1]);
|
gp.AddLine(points[i], points[i + 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (len > 2)
|
if (points.Count > 2)
|
||||||
{
|
{
|
||||||
gp.AddLine(points[len - 1], points[0]);
|
gp.AddLine(points[points.Count - 1], points[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
gp.CloseFigure();
|
gp.CloseFigure();
|
||||||
|
|
Loading…
Reference in a new issue