mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 15:32:38 +00:00
Fix a problem not showing the "modified" state in tabs correctly after the first DrawingState.
This commit is contained in:
parent
3bbf7af991
commit
805a0333d7
@ -58,10 +58,7 @@ DrawingState::DrawingState(tools::ToolLoop* toolLoop, Editor* editor, Message* m
|
||||
|
||||
DrawingState::~DrawingState()
|
||||
{
|
||||
delete m_toolLoopManager;
|
||||
delete m_toolLoop;
|
||||
m_toolLoopManager = NULL;
|
||||
m_toolLoop = NULL;
|
||||
destroyLoop();
|
||||
}
|
||||
|
||||
bool DrawingState::onMouseDown(Editor* editor, Message* msg)
|
||||
@ -75,9 +72,7 @@ bool DrawingState::onMouseDown(Editor* editor, Message* msg)
|
||||
// Cancel drawing loop
|
||||
if (m_toolLoopManager->isCanceled()) {
|
||||
m_toolLoopManager->releaseLoop(pointer_from_msg(msg));
|
||||
|
||||
delete m_toolLoopManager;
|
||||
m_toolLoopManager = NULL;
|
||||
destroyLoop();
|
||||
|
||||
// Change to standby state
|
||||
editor->backToPreviousState();
|
||||
@ -96,6 +91,7 @@ bool DrawingState::onMouseUp(Editor* editor, Message* msg)
|
||||
return true;
|
||||
|
||||
m_toolLoopManager->releaseLoop(pointer_from_msg(msg));
|
||||
destroyLoop();
|
||||
|
||||
// Back to standby state.
|
||||
editor->backToPreviousState();
|
||||
@ -162,3 +158,11 @@ bool DrawingState::onUpdateStatusBar(Editor* editor)
|
||||
// method called by the ToolLoopManager.
|
||||
return false;
|
||||
}
|
||||
|
||||
void DrawingState::destroyLoop()
|
||||
{
|
||||
delete m_toolLoopManager;
|
||||
delete m_toolLoop;
|
||||
m_toolLoopManager = NULL;
|
||||
m_toolLoop = NULL;
|
||||
}
|
||||
|
@ -45,6 +45,8 @@ public:
|
||||
virtual bool requirePenPreview() OVERRIDE { return false; }
|
||||
|
||||
private:
|
||||
void destroyLoop();
|
||||
|
||||
// The tool-loop.
|
||||
tools::ToolLoop* m_toolLoop;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user