mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 09:17:36 +13:00
Deselect shape before selecting new one, this ensures the correct behavior when switching between types
This commit is contained in:
parent
2957763918
commit
f34666816b
1 changed files with 4 additions and 3 deletions
|
@ -96,12 +96,12 @@ public ShapeType CurrentTool
|
|||
if (CurrentShape != null)
|
||||
{
|
||||
// do not keep selection if select tool does not handle it
|
||||
if ((currentTool == ShapeType.ToolSelect && !CurrentShape.IsHandledBySelectTool))
|
||||
if (currentTool == ShapeType.ToolSelect && !CurrentShape.IsHandledBySelectTool)
|
||||
{
|
||||
DeselectCurrentShape();
|
||||
}
|
||||
// do not keep selection if we switch away from select tool and the selected shape does not match the new type
|
||||
else if (previousTool == ShapeType.ToolSelect && CurrentShape.ShapeType != currentTool)
|
||||
// do not keep selection if we switch away from a tool and the selected shape does not match the new type
|
||||
else if (CurrentShape.ShapeType != currentTool)
|
||||
{
|
||||
DeselectCurrentShape();
|
||||
}
|
||||
|
@ -820,6 +820,7 @@ private void StartRegionSelection()
|
|||
|
||||
if (shape != null && shape.IsSelectable) // Select shape
|
||||
{
|
||||
DeselectCurrentShape();
|
||||
IsMoving = true;
|
||||
shape.OnMoving();
|
||||
Form.Cursor = Cursors.SizeAll;
|
||||
|
|
Loading…
Reference in a new issue