mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-14 04:19:12 +00:00
Fix crash pressing Shift+C on Home tab or when all sprites are closed
This commit is contained in:
parent
5d0d609a3f
commit
ada6c0666c
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -22,6 +22,7 @@ public:
|
||||
Command* clone() const override { return new ScrollCenterCommand(*this); }
|
||||
|
||||
protected:
|
||||
bool onEnabled(Context* context) override;
|
||||
void onExecute(Context* context) override;
|
||||
};
|
||||
|
||||
@ -32,6 +33,11 @@ ScrollCenterCommand::ScrollCenterCommand()
|
||||
{
|
||||
}
|
||||
|
||||
bool ScrollCenterCommand::onEnabled(Context* context)
|
||||
{
|
||||
return (current_editor != nullptr);
|
||||
}
|
||||
|
||||
void ScrollCenterCommand::onExecute(Context* context)
|
||||
{
|
||||
current_editor->setDefaultScroll();
|
||||
|
Loading…
x
Reference in New Issue
Block a user