mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-30 04:20:23 +00:00
Fix crash calling PaletteSize without active sprite
This commit is contained in:
parent
56ae29a9b4
commit
bc824ed9e6
@ -1,5 +1,5 @@
|
|||||||
// Aseprite
|
// Aseprite
|
||||||
// Copyright (C) 2019-2020 Igara Studio S.A.
|
// Copyright (C) 2019-2021 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2018 David Capello
|
// Copyright (C) 2001-2018 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
@ -30,6 +30,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void onLoadParams(const Params& params) override;
|
void onLoadParams(const Params& params) override;
|
||||||
|
bool onEnabled(Context* context) override;
|
||||||
void onExecute(Context* context) override;
|
void onExecute(Context* context) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -47,6 +48,11 @@ void PaletteSizeCommand::onLoadParams(const Params& params)
|
|||||||
m_size = params.get_as<int>("size");
|
m_size = params.get_as<int>("size");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PaletteSizeCommand::onEnabled(Context* context)
|
||||||
|
{
|
||||||
|
return context->checkFlags(ContextFlags::ActiveDocumentIsWritable);
|
||||||
|
}
|
||||||
|
|
||||||
void PaletteSizeCommand::onExecute(Context* context)
|
void PaletteSizeCommand::onExecute(Context* context)
|
||||||
{
|
{
|
||||||
ContextReader reader(context);
|
ContextReader reader(context);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user