mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-29 21:33:12 +00:00
Avoid moving the playback cue when decrementing a ping-pong tag's repeat field that has only one frame (fix #4336)
This commit is contained in:
parent
c64756ebde
commit
7b9594f4e0
@ -435,7 +435,8 @@ bool Playback::decrementRepeat(const frame_t frameDelta)
|
||||
PLAY_TRACE(" Repeat tag", tag->name(), " frame=", m_frame,
|
||||
"repeat=", m_playing.back()->repeat,
|
||||
"forward=", m_playing.back()->forward);
|
||||
return true;
|
||||
// Tag has only 1 frame, then don't move the playback cue.
|
||||
return tag->frames() > 1;
|
||||
}
|
||||
else {
|
||||
// Remove tag from played
|
||||
|
@ -282,6 +282,48 @@ TEST(Playback, SimplePingPong3)
|
||||
EXPECT_FALSE(play.isStopped());
|
||||
}
|
||||
|
||||
TEST(Playback, SimplePingPong4)
|
||||
{
|
||||
// A
|
||||
// <>
|
||||
// 0
|
||||
|
||||
Tag* a = make_tag("A", 0, 0, AniDir::PING_PONG, 1);
|
||||
auto sprite = make_sprite(1, { a });
|
||||
|
||||
Playback play(sprite.get(), 0, Playback::Mode::PlayAll);
|
||||
expect_frames(play, {0,0});
|
||||
EXPECT_TRUE(play.isStopped());
|
||||
}
|
||||
|
||||
TEST(Playback, SimplePingPong5)
|
||||
{
|
||||
// A
|
||||
// <>
|
||||
// 0
|
||||
|
||||
Tag* a = make_tag("A", 0, 0, AniDir::PING_PONG, 3);
|
||||
auto sprite = make_sprite(1, { a });
|
||||
|
||||
Playback play(sprite.get(), 0, Playback::Mode::PlayAll);
|
||||
expect_frames(play, {0,0,0,0});
|
||||
EXPECT_TRUE(play.isStopped());
|
||||
}
|
||||
|
||||
TEST(Playback, SimplePingPong6)
|
||||
{
|
||||
// A
|
||||
// <>
|
||||
// 0
|
||||
|
||||
Tag* a = make_tag("A", 0, 0, AniDir::PING_PONG, 0);
|
||||
auto sprite = make_sprite(1, { a });
|
||||
|
||||
Playback play(sprite.get(), 0, Playback::Mode::PlayAll);
|
||||
expect_frames(play, {0,0,0});
|
||||
EXPECT_TRUE(play.isStopped());
|
||||
}
|
||||
|
||||
TEST(Playback, SimplePingPong3Repeats)
|
||||
{
|
||||
// A
|
||||
@ -297,6 +339,7 @@ TEST(Playback, SimplePingPong3Repeats)
|
||||
EXPECT_FALSE(play.isStopped());
|
||||
}
|
||||
|
||||
|
||||
TEST(Playback, TagOneFrame)
|
||||
{
|
||||
// A
|
||||
|
Loading…
x
Reference in New Issue
Block a user