mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-29 03:32:48 +00:00
Fix crash deleting a tag that is being played in the Preview window
Fix: https://community.aseprite.org/t/consistent-crashing-when-deleting-loop-tag/1984
This commit is contained in:
parent
c05c3dad43
commit
22f172c932
@ -1950,6 +1950,8 @@ void Editor::onAddFrameTag(DocEvent& ev)
|
||||
void Editor::onRemoveFrameTag(DocEvent& ev)
|
||||
{
|
||||
m_tagFocusBand = -1;
|
||||
if (m_state)
|
||||
m_state->onRemoveFrameTag(this, ev.frameTag());
|
||||
}
|
||||
|
||||
void Editor::setCursor(const gfx::Point& mouseScreenPos)
|
||||
|
@ -22,6 +22,10 @@ namespace ui {
|
||||
class TouchMessage;
|
||||
}
|
||||
|
||||
namespace doc {
|
||||
class FrameTag;
|
||||
}
|
||||
|
||||
namespace app {
|
||||
class Editor;
|
||||
class EditorDecorator;
|
||||
@ -117,6 +121,9 @@ namespace app {
|
||||
// Custom ink in this state.
|
||||
virtual tools::Ink* getStateInk() { return nullptr; }
|
||||
|
||||
// Called when a tag is deleted.
|
||||
virtual void onRemoveFrameTag(Editor* editor, doc::FrameTag* tag) { }
|
||||
|
||||
private:
|
||||
DISABLE_COPYING(EditorState);
|
||||
};
|
||||
|
@ -167,6 +167,12 @@ bool PlayState::onSetCursor(Editor* editor, const gfx::Point& mouseScreenPos)
|
||||
return true;
|
||||
}
|
||||
|
||||
void PlayState::onRemoveFrameTag(Editor* editor, doc::FrameTag* tag)
|
||||
{
|
||||
if (m_tag == tag)
|
||||
m_tag = nullptr;
|
||||
}
|
||||
|
||||
void PlayState::onPlaybackTick()
|
||||
{
|
||||
ASSERT(m_playTimer.isRunning());
|
||||
|
@ -35,6 +35,7 @@ namespace app {
|
||||
bool onKeyDown(Editor* editor, ui::KeyMessage* msg) override;
|
||||
bool onKeyUp(Editor* editor, ui::KeyMessage* msg) override;
|
||||
bool onSetCursor(Editor* editor, const gfx::Point& mouseScreenPos) override;
|
||||
void onRemoveFrameTag(Editor* editor, doc::FrameTag* tag) override;
|
||||
|
||||
private:
|
||||
void onPlaybackTick();
|
||||
|
Loading…
x
Reference in New Issue
Block a user