lua: Rename app.toolStroke() -> app.useTool()

This function was called app.drawWithTool() first, but some tools do
not "draw" (e.g. eraser, selection-like tools, etc.). And then the
app.toolStroke() name could be confused with the Edit > Stroke
command.
This commit is contained in:
David Capello 2019-03-23 13:31:14 -03:00
parent 7d8e493dca
commit 98080544cf

View File

@ -190,11 +190,11 @@ int App_refresh(lua_State* L)
return 0;
}
int App_toolStroke(lua_State* L)
int App_useTool(lua_State* L)
{
// First argument must be a table
if (!lua_istable(L, 1))
return luaL_error(L, "app.toolStroke() must be called with a table as its first argument");
return luaL_error(L, "app.useTool() must be called with a table as its first argument");
auto ctx = App::instance()->context();
Doc* doc = ctx->activeDocument();
@ -511,7 +511,7 @@ const luaL_Reg App_methods[] = {
{ "redo", App_redo },
{ "alert", App_alert },
{ "refresh", App_refresh },
{ "toolStroke", App_toolStroke },
{ "useTool", App_useTool },
{ nullptr, nullptr }
};