mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-04 08:46:09 +00:00
respect slice keys frame number on ase file format (fix #4062)
This commit is contained in:
parent
f6db44b81d
commit
4fc36aaf02
@ -1252,7 +1252,8 @@ static void ase_file_write_slice_chunk(FILE* f, dio::AsepriteFrameHeader* frame_
|
||||
{
|
||||
ChunkWriter chunk(f, frame_header, ASE_FILE_CHUNK_SLICE);
|
||||
|
||||
auto range = slice->range(fromFrame, toFrame);
|
||||
frame_t firstFromFrame = slice->empty() ? fromFrame : slice->fromFrame();
|
||||
auto range = slice->range(firstFromFrame, toFrame);
|
||||
ASSERT(!range.empty());
|
||||
|
||||
int flags = 0;
|
||||
@ -1268,10 +1269,10 @@ static void ase_file_write_slice_chunk(FILE* f, dio::AsepriteFrameHeader* frame_
|
||||
fputl(0, f); // 4 bytes reserved
|
||||
ase_file_write_string(f, slice->name()); // slice name
|
||||
|
||||
frame_t frame = fromFrame;
|
||||
frame_t frame = firstFromFrame;
|
||||
const SliceKey* oldKey = nullptr;
|
||||
for (auto key : range) {
|
||||
if (frame == fromFrame || key != oldKey) {
|
||||
if (frame == firstFromFrame || key != oldKey) {
|
||||
fputl(frame, f);
|
||||
fputl((int32_t)(key ? key->bounds().x: 0), f);
|
||||
fputl((int32_t)(key ? key->bounds().y: 0), f);
|
||||
|
Loading…
Reference in New Issue
Block a user