mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-26 08:37:08 +00:00
Fix bug "Rewind on Stop" increments start frame randomly (fix #1569)
This commit is contained in:
parent
49d2cd14f0
commit
7b7b12b593
@ -92,13 +92,13 @@ void PlayState::onEnterState(Editor* editor)
|
||||
|
||||
EditorState::LeaveAction PlayState::onLeaveState(Editor* editor, EditorState* newState)
|
||||
{
|
||||
// We don't stop the timer if we are going to the ScrollingState
|
||||
// (we keep playing the animation).
|
||||
if (!m_toScroll) {
|
||||
m_playTimer.stop();
|
||||
|
||||
if (m_playOnce || Preferences::instance().general.rewindOnStop())
|
||||
m_editor->setFrame(m_refFrame);
|
||||
|
||||
// We don't stop the timer if we are going to the ScrollingState
|
||||
// (we keep playing the animation).
|
||||
m_playTimer.stop();
|
||||
}
|
||||
return KeepState;
|
||||
}
|
||||
@ -169,6 +169,8 @@ bool PlayState::onSetCursor(Editor* editor, const gfx::Point& mouseScreenPos)
|
||||
|
||||
void PlayState::onPlaybackTick()
|
||||
{
|
||||
ASSERT(m_playTimer.isRunning());
|
||||
|
||||
if (m_nextFrameTime < 0)
|
||||
return;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite UI Library
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
// Copyright (C) 2001-2017 David Capello
|
||||
//
|
||||
// This file is released under the terms of the MIT license.
|
||||
// Read LICENSE.txt for more information.
|
||||
@ -41,8 +41,8 @@ Timer::~Timer()
|
||||
ASSERT(it != timers.end());
|
||||
timers.erase(it);
|
||||
|
||||
// Remove messages of this timer in the queue
|
||||
Manager::getDefault()->removeMessagesForTimer(this);
|
||||
// Stop the timer and remove it from the message queue.
|
||||
stop();
|
||||
}
|
||||
|
||||
void Timer::start()
|
||||
@ -54,6 +54,12 @@ void Timer::start()
|
||||
void Timer::stop()
|
||||
{
|
||||
m_running = false;
|
||||
|
||||
// Remove messages of this timer in the queue. The expected behavior
|
||||
// is that when we stop a timer, we'll not receive more messages
|
||||
// about it (even if there are enqueued messages waiting in the
|
||||
// message queue).
|
||||
Manager::getDefault()->removeMessagesForTimer(this);
|
||||
}
|
||||
|
||||
void Timer::tick()
|
||||
|
Loading…
x
Reference in New Issue
Block a user