mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-06 21:39:57 +00:00
Fix bug restoring frame duration after undoing a "remove frame" (fix #965)
This commit is contained in:
parent
e2e5fbf3f1
commit
dbb8a17d47
@ -1,5 +1,5 @@
|
|||||||
// Aseprite
|
// Aseprite
|
||||||
// Copyright (C) 2001-2015 David Capello
|
// Copyright (C) 2001-2016 David Capello
|
||||||
//
|
//
|
||||||
// This program is free software; you can redistribute it and/or modify
|
// This program is free software; you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License version 2 as
|
// it under the terms of the GNU General Public License version 2 as
|
||||||
@ -27,6 +27,7 @@ RemoveFrame::RemoveFrame(Sprite* sprite, frame_t frame)
|
|||||||
, m_frame(frame)
|
, m_frame(frame)
|
||||||
, m_firstTime(true)
|
, m_firstTime(true)
|
||||||
{
|
{
|
||||||
|
m_frameDuration = sprite->frameDuration(frame);
|
||||||
for (Cel* cel : sprite->cels(m_frame))
|
for (Cel* cel : sprite->cels(m_frame))
|
||||||
m_seq.add(new cmd::RemoveCel(cel));
|
m_seq.add(new cmd::RemoveCel(cel));
|
||||||
}
|
}
|
||||||
@ -59,6 +60,7 @@ void RemoveFrame::onUndo()
|
|||||||
Document* doc = sprite->document();
|
Document* doc = sprite->document();
|
||||||
|
|
||||||
sprite->addFrame(m_frame);
|
sprite->addFrame(m_frame);
|
||||||
|
sprite->setFrameDuration(m_frame, m_frameDuration);
|
||||||
sprite->incrementVersion();
|
sprite->incrementVersion();
|
||||||
m_seq.undo();
|
m_seq.undo();
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// Aseprite
|
// Aseprite
|
||||||
// Copyright (C) 2001-2015 David Capello
|
// Copyright (C) 2001-2016 David Capello
|
||||||
//
|
//
|
||||||
// This program is free software; you can redistribute it and/or modify
|
// This program is free software; you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License version 2 as
|
// it under the terms of the GNU General Public License version 2 as
|
||||||
@ -32,6 +32,7 @@ namespace cmd {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
frame_t m_frame;
|
frame_t m_frame;
|
||||||
|
int m_frameDuration;
|
||||||
CmdSequence m_seq;
|
CmdSequence m_seq;
|
||||||
bool m_firstTime;
|
bool m_firstTime;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user