Removed unneeded variable, ensure shape stays selected after drawing

This commit is contained in:
Daniel Kuschny 2019-04-29 18:28:54 +02:00
parent e3b39685a0
commit 8cb8416cd4

View file

@ -72,7 +72,6 @@ public ShapeType CurrentTool
{
if (currentTool == value) return;
ShapeType previousTool = currentTool;
currentTool = value;
if (Form.IsAnnotationMode)
@ -96,9 +95,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)
{
DeselectCurrentShape();
if (!CurrentShape.IsHandledBySelectTool)
{
DeselectCurrentShape();
}
}
// 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)