mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-04 04:06:05 +13:00
Added shape move support when creating (hold ctrl when dragging region)
This commit is contained in:
parent
ad21a0bad2
commit
70d959da89
1 changed files with 13 additions and 2 deletions
|
@ -168,6 +168,7 @@ public bool IsResizing
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsProportionalResizing { get; private set; }
|
public bool IsProportionalResizing { get; private set; }
|
||||||
|
public bool IsCornerMoving { get; private set; }
|
||||||
public bool IsSnapResizing { get; private set; }
|
public bool IsSnapResizing { get; private set; }
|
||||||
|
|
||||||
public List<SimpleWindowInfo> Windows { get; set; }
|
public List<SimpleWindowInfo> Windows { get; set; }
|
||||||
|
@ -890,6 +891,9 @@ private void form_KeyDown(object sender, KeyEventArgs e)
|
||||||
case Keys.ShiftKey:
|
case Keys.ShiftKey:
|
||||||
IsProportionalResizing = true;
|
IsProportionalResizing = true;
|
||||||
break;
|
break;
|
||||||
|
case Keys.ControlKey:
|
||||||
|
IsCornerMoving = true;
|
||||||
|
break;
|
||||||
case Keys.Menu:
|
case Keys.Menu:
|
||||||
IsSnapResizing = true;
|
IsSnapResizing = true;
|
||||||
break;
|
break;
|
||||||
|
@ -940,6 +944,9 @@ private void form_KeyUp(object sender, KeyEventArgs e)
|
||||||
case Keys.ShiftKey:
|
case Keys.ShiftKey:
|
||||||
IsProportionalResizing = false;
|
IsProportionalResizing = false;
|
||||||
break;
|
break;
|
||||||
|
case Keys.ControlKey:
|
||||||
|
IsCornerMoving = false;
|
||||||
|
break;
|
||||||
case Keys.Menu:
|
case Keys.Menu:
|
||||||
IsSnapResizing = false;
|
IsSnapResizing = false;
|
||||||
break;
|
break;
|
||||||
|
@ -981,8 +988,12 @@ public void Update()
|
||||||
newPosition = CaptureHelpers.SnapPositionToDegree(PositionOnClick, CurrentPosition, 45, 0);
|
newPosition = CaptureHelpers.SnapPositionToDegree(PositionOnClick, CurrentPosition, 45, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (IsCornerMoving)
|
||||||
if (IsSnapResizing)
|
{
|
||||||
|
PositionOnClick = PositionOnClick.Add(InputManager.MouseVelocity.X, InputManager.MouseVelocity.Y);
|
||||||
|
shape.StartPosition = PositionOnClick;
|
||||||
|
}
|
||||||
|
else if (IsSnapResizing)
|
||||||
{
|
{
|
||||||
newPosition = SnapPosition(PositionOnClick, newPosition);
|
newPosition = SnapPosition(PositionOnClick, newPosition);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue