mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-23 18:39:55 +00:00
Fix {duration} file format always gives an incorrect number (fix #2998)
Before this fix, the string '{duration}' in the file format gave an incorrect/random and constant number across all frames. This happened in Save-AS, Export File, CLI, Json on Export Sprite Sheet.
This commit is contained in:
parent
a85b61e4b1
commit
16362cc511
@ -676,7 +676,8 @@ FileOp* FileOp::createSaveDocumentOperation(const Context* context,
|
|||||||
.outerTagName(outerTag ? outerTag->name(): "")
|
.outerTagName(outerTag ? outerTag->name(): "")
|
||||||
.frame(outputFrame)
|
.frame(outputFrame)
|
||||||
.tagFrame(innerTag ? frame - innerTag->fromFrame():
|
.tagFrame(innerTag ? frame - innerTag->fromFrame():
|
||||||
outputFrame);
|
outputFrame)
|
||||||
|
.duration(spr->frameDuration(frame));
|
||||||
|
|
||||||
fop->m_seq.filename_list.push_back(
|
fop->m_seq.filename_list.push_back(
|
||||||
filename_formatter(fn_format, fnInfo));
|
filename_formatter(fn_format, fnInfo));
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
// Aseprite
|
// Aseprite
|
||||||
|
// Copyright (C) 2022 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2017 David Capello
|
// Copyright (C) 2001-2017 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
@ -112,12 +113,12 @@ std::string filename_formatter(
|
|||||||
base::replace_string(output, "{layer}", info.layerName());
|
base::replace_string(output, "{layer}", info.layerName());
|
||||||
base::replace_string(output, "{group}", info.groupName());
|
base::replace_string(output, "{group}", info.groupName());
|
||||||
base::replace_string(output, "{slice}", info.sliceName());
|
base::replace_string(output, "{slice}", info.sliceName());
|
||||||
base::replace_string(output, "{duration}", std::to_string(info.duration()));
|
|
||||||
|
|
||||||
if (replaceFrame) {
|
if (replaceFrame) {
|
||||||
base::replace_string(output, "{tag}", info.innerTagName());
|
base::replace_string(output, "{tag}", info.innerTagName());
|
||||||
base::replace_string(output, "{innertag}", info.innerTagName());
|
base::replace_string(output, "{innertag}", info.innerTagName());
|
||||||
base::replace_string(output, "{outertag}", info.outerTagName());
|
base::replace_string(output, "{outertag}", info.outerTagName());
|
||||||
|
base::replace_string(output, "{duration}", std::to_string(info.duration()));
|
||||||
replace_frame("{frame", info.frame(), output);
|
replace_frame("{frame", info.frame(), output);
|
||||||
replace_frame("{tagframe", info.tagFrame(), output);
|
replace_frame("{tagframe", info.tagFrame(), output);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user