Skip to content

Commit

Permalink
Fix Cancel command do not work on scripting
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Gasparoken committed Aug 29, 2024
1 parent e87f6df commit 1c0545d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/app/commands/cmd_cancel.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 1c0545d

Please sign in to comment.