Return Selection tool activation errors to command callers

This commit is contained in:
yoriswind
2026-11-18 12:47:35 -08:00
parent f93a92a227
commit 0a389319d6
+1 -2
View File
@@ -706,8 +706,7 @@ fn run_ui_part6(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Result<
}
"tool.switchSelectionTools" => {
let tool = if app.session.tool_id() == "selection" { "directSelection" } else { "selection" };
app.select_tool(tool);
Ok(json!({"tool": app.session.tool_id()}))
app.try_select_tool(tool).map(|()| json!({"tool": app.session.tool_id()}))
}
crate::touch::TOGGLE_MODE => crate::touch::toggle_mode(app),
crate::addons::pathtools::corner::COMMAND => crate::addons::pathtools::corner::open(app),