From 8323a555007e1db9670b098ce4b1b9c5f8b3d7ad Mon Sep 17 00:00:00 2001 From: Gaspar Capello Date: Thu, 29 Aug 2024 09:57:17 -0300 Subject: [PATCH] Fix Cancel command do not work on scripting Before this fix, the 'Cancel' command did not work in the following specific situation: As soon as Aseprite was started and without hitting the 'Esc' key, the 'app.command.Cancel()' command did not perform any operation. It was discovered that the Cancel command is started only once per session and retains the 'm_type' throughout the session. Only a specific: app.command.Cancel {type = "all"} or app.command.Cancel {type = "noop"} could change the command type. --- src/app/commands/cmd_cancel.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/commands/cmd_cancel.cpp b/src/app/commands/cmd_cancel.cpp index 8991a555e..794781243 100644 --- a/src/app/commands/cmd_cancel.cpp +++ b/src/app/commands/cmd_cancel.cpp @@ -1,4 +1,5 @@ // Aseprite +// Copyright (C) 2024 Igara Studio S.A. // Copyright (C) 2001-2017 David Capello // // This program is distributed under the terms of @@ -47,6 +48,8 @@ void CancelCommand::onLoadParams(const Params& params) std::string type = params.get("type"); if (type == "noop") m_type = NoOp; else if (type == "all") m_type = All; + // TODO: add specific types for selection/ranges during scripting. + else m_type = All; } void CancelCommand::onExecute(Context* context)