mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
Set rectangle instead of start/end positions
This commit is contained in:
parent
7766ba374e
commit
6a072fa079
5 changed files with 5 additions and 14 deletions
|
@ -128,8 +128,7 @@ public void AddShapePath(GraphicsPath gp, int sizeOffset = 0)
|
|||
|
||||
public virtual void Move(int x, int y)
|
||||
{
|
||||
StartPosition = StartPosition.Add(x, y);
|
||||
EndPosition = EndPosition.Add(x, y);
|
||||
Rectangle = Rectangle.LocationOffset(x, y);
|
||||
}
|
||||
|
||||
public void Move(Point offset)
|
||||
|
|
|
@ -50,8 +50,7 @@ public void UpdateCursor(IntPtr cursorHandle, Point position)
|
|||
Icon icon = Icon.FromHandle(cursorHandle);
|
||||
cursorBitmap = icon.ToBitmap();
|
||||
|
||||
StartPosition = position;
|
||||
EndPosition = new Point(position.X + cursorBitmap.Size.Width - 1, position.Y + cursorBitmap.Size.Height - 1);
|
||||
Rectangle = new Rectangle(position, cursorBitmap.Size);
|
||||
}
|
||||
|
||||
public override void ShowNodes()
|
||||
|
|
|
@ -185,10 +185,6 @@ public override void OnNodeVisible()
|
|||
|
||||
public override void OnNodeUpdate()
|
||||
{
|
||||
if (Manager.IsCornerMoving && !Manager.IsMoving && !Manager.IsPanning)
|
||||
{
|
||||
Move(InputManager.MouseVelocity);
|
||||
}
|
||||
if (Manager.ResizeNodes[0].IsDragging)
|
||||
{
|
||||
Manager.IsResizing = true;
|
||||
|
|
|
@ -40,8 +40,7 @@ public class StepDrawingShape : EllipseDrawingShape
|
|||
|
||||
public StepDrawingShape()
|
||||
{
|
||||
StartPosition = new Point(0, 0);
|
||||
EndPosition = new Point(DefaultSize - 1, DefaultSize - 1);
|
||||
Rectangle = new Rectangle(0, 0, DefaultSize, DefaultSize);
|
||||
}
|
||||
|
||||
public override void ShowNodes()
|
||||
|
@ -52,8 +51,7 @@ public override void OnCreating()
|
|||
{
|
||||
Manager.IsMoving = true;
|
||||
Point pos = InputManager.ClientMousePosition;
|
||||
StartPosition = new Point(pos.X - DefaultSize / 2, pos.Y - DefaultSize / 2);
|
||||
EndPosition = new Point(pos.X + DefaultSize / 2 - 1, pos.Y + DefaultSize / 2 - 1);
|
||||
Rectangle = new Rectangle(new Point(pos.X - Rectangle.Width / 2, pos.Y - Rectangle.Height / 2), Rectangle.Size);
|
||||
}
|
||||
|
||||
public override void OnConfigLoad()
|
||||
|
|
|
@ -163,8 +163,7 @@ public void AutoSize(bool center)
|
|||
location = Rectangle.Location;
|
||||
}
|
||||
|
||||
StartPosition = location;
|
||||
EndPosition = new Point(location.X + size.Width - 1, location.Y + size.Height - 1);
|
||||
Rectangle = new Rectangle(location, size);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue