mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-29 19:20:09 +00:00
Fix modifying slice bounds before the 1st SliceKey frame (fix #3122)
This issue brought a lot of other related issues (like slice chunks being saved incorrectly in .aseprite file, etc.). This is an alternative fix to PR #3141 where a std::sort() was proposed.
This commit is contained in:
parent
2100c45de2
commit
2bb93247aa
@ -132,7 +132,12 @@ namespace doc {
|
||||
else if (it->frame() == frame)
|
||||
it->setValue(std::move(value));
|
||||
else {
|
||||
++it;
|
||||
// We must insert keys in order. So if "frame" is less than
|
||||
// the "it" frame, insert() will insert the new key before the
|
||||
// iterator just as we want. In other case we have to use the
|
||||
// next iterator (++it).
|
||||
if (frame > it->frame())
|
||||
++it;
|
||||
m_keys.insert(it, Key(frame, std::move(value)));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user