Fix "Finish" buttons not clearing tool properly

This commit is contained in:
David Rowe 2017-08-22 14:35:56 +12:00
parent 72166dcfab
commit c953df0040
2 changed files with 12 additions and 3 deletions

View file

@ -336,7 +336,7 @@ ToolMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
}, },
label: "FINISH", label: "FINISH",
command: { command: {
method: "closeOptions" method: "clearTool"
} }
} }
], ],
@ -358,7 +358,7 @@ ToolMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
}, },
label: "FINISH", label: "FINISH",
command: { command: {
method: "closeOptions" method: "clearTool"
} }
} }
], ],
@ -813,7 +813,7 @@ ToolMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
}, },
label: "FINISH", label: "FINISH",
command: { command: {
method: "closeOptions" method: "clearTool"
} }
} }
] ]
@ -1619,6 +1619,10 @@ ToolMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
closeOptions(); closeOptions();
break; break;
case "clearTool":
uiCommandCallback("clearTool");
break;
default: default:
App.log(side, "ERROR: ToolMenu: Unexpected command! " + command); App.log(side, "ERROR: ToolMenu: Unexpected command! " + command);
} }

View file

@ -846,6 +846,7 @@
toolSelected = TOOL_NONE; toolSelected = TOOL_NONE;
grouping.clear(); grouping.clear();
ui.clearTool(); ui.clearTool();
ui.updateUIEntities();
} }
} }
@ -1378,6 +1379,10 @@
ui.setToolIcon(ui.DELETE_TOOL); ui.setToolIcon(ui.DELETE_TOOL);
ui.updateUIEntities(); ui.updateUIEntities();
break; break;
case "clearTool":
ui.clearTool();
ui.updateUIEntities();
break;
case "groupButton": case "groupButton":
grouping.group(); grouping.group();