From 98080544cf09ebd04c1a880f9923102df9470856 Mon Sep 17 00:00:00 2001 From: David Capello Date: Sat, 23 Mar 2019 13:31:14 -0300 Subject: [PATCH] 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. --- src/app/script/app_object.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/script/app_object.cpp b/src/app/script/app_object.cpp index f072cf65a..a4f2ba93d 100644 --- a/src/app/script/app_object.cpp +++ b/src/app/script/app_object.cpp @@ -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 } };