mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
Avoid effect flicker when moving with keyboard
This commit is contained in:
parent
5d1c347644
commit
782099c5c8
1 changed files with 19 additions and 2 deletions
|
@ -559,13 +559,13 @@ private void form_KeyDown(object sender, KeyEventArgs e)
|
|||
{
|
||||
if (e.Control)
|
||||
{
|
||||
shape.OnMoving();
|
||||
shape.Move(x, y);
|
||||
shape.OnMoved();
|
||||
}
|
||||
else
|
||||
{
|
||||
shape.OnResizing();
|
||||
shape.Resize(x, y, !e.Alt);
|
||||
shape.OnResized();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -587,22 +587,39 @@ private void form_KeyUp(object sender, KeyEventArgs e)
|
|||
case Keys.Left:
|
||||
case Keys.A:
|
||||
isLeftPressed = false;
|
||||
ShapeMoved();
|
||||
break;
|
||||
case Keys.Right:
|
||||
case Keys.D:
|
||||
isRightPressed = false;
|
||||
ShapeMoved();
|
||||
break;
|
||||
case Keys.Up:
|
||||
case Keys.W:
|
||||
isUpPressed = false;
|
||||
ShapeMoved();
|
||||
break;
|
||||
case Keys.Down:
|
||||
case Keys.S:
|
||||
isDownPressed = false;
|
||||
ShapeMoved();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void ShapeMoved()
|
||||
{
|
||||
if (!IsCreating)
|
||||
{
|
||||
BaseShape shape = CurrentShape;
|
||||
|
||||
if (shape != null)
|
||||
{
|
||||
shape.OnMoved();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void RunAction(RegionCaptureAction action)
|
||||
{
|
||||
switch (action)
|
||||
|
|
Loading…
Reference in a new issue