mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 06:32:42 +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)
|
void Editor::onRemoveFrameTag(DocEvent& ev)
|
||||||
{
|
{
|
||||||
m_tagFocusBand = -1;
|
m_tagFocusBand = -1;
|
||||||
|
if (m_state)
|
||||||
|
m_state->onRemoveFrameTag(this, ev.frameTag());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Editor::setCursor(const gfx::Point& mouseScreenPos)
|
void Editor::setCursor(const gfx::Point& mouseScreenPos)
|
||||||
|
@ -22,6 +22,10 @@ namespace ui {
|
|||||||
class TouchMessage;
|
class TouchMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace doc {
|
||||||
|
class FrameTag;
|
||||||
|
}
|
||||||
|
|
||||||
namespace app {
|
namespace app {
|
||||||
class Editor;
|
class Editor;
|
||||||
class EditorDecorator;
|
class EditorDecorator;
|
||||||
@ -117,6 +121,9 @@ namespace app {
|
|||||||
// Custom ink in this state.
|
// Custom ink in this state.
|
||||||
virtual tools::Ink* getStateInk() { return nullptr; }
|
virtual tools::Ink* getStateInk() { return nullptr; }
|
||||||
|
|
||||||
|
// Called when a tag is deleted.
|
||||||
|
virtual void onRemoveFrameTag(Editor* editor, doc::FrameTag* tag) { }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DISABLE_COPYING(EditorState);
|
DISABLE_COPYING(EditorState);
|
||||||
};
|
};
|
||||||
|
@ -167,6 +167,12 @@ bool PlayState::onSetCursor(Editor* editor, const gfx::Point& mouseScreenPos)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PlayState::onRemoveFrameTag(Editor* editor, doc::FrameTag* tag)
|
||||||
|
{
|
||||||
|
if (m_tag == tag)
|
||||||
|
m_tag = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
void PlayState::onPlaybackTick()
|
void PlayState::onPlaybackTick()
|
||||||
{
|
{
|
||||||
ASSERT(m_playTimer.isRunning());
|
ASSERT(m_playTimer.isRunning());
|
||||||
|
@ -35,6 +35,7 @@ namespace app {
|
|||||||
bool onKeyDown(Editor* editor, ui::KeyMessage* msg) override;
|
bool onKeyDown(Editor* editor, ui::KeyMessage* msg) override;
|
||||||
bool onKeyUp(Editor* editor, ui::KeyMessage* msg) override;
|
bool onKeyUp(Editor* editor, ui::KeyMessage* msg) override;
|
||||||
bool onSetCursor(Editor* editor, const gfx::Point& mouseScreenPos) override;
|
bool onSetCursor(Editor* editor, const gfx::Point& mouseScreenPos) override;
|
||||||
|
void onRemoveFrameTag(Editor* editor, doc::FrameTag* tag) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void onPlaybackTick();
|
void onPlaybackTick();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user