mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-14 13:21:34 +00:00
Merge 6015ddb79d7431bf9f5c3b3585a6c10061010d13 into f2b870a17f2a3a6c1b00e341b2b1d0216db0dc3b
This commit is contained in:
commit
bec1ada006
@ -1387,6 +1387,34 @@ void DocExporter::createDataFile(const Samples& samples, std::ostream& os, doc::
|
||||
<< "\"h\": " << texture->height() << " },\n"
|
||||
<< " \"scale\": \"1\"";
|
||||
|
||||
{
|
||||
os << ",\n"
|
||||
<< " \"documents\": [";
|
||||
|
||||
bool firstDoc = true;
|
||||
|
||||
std::set<doc::ObjectId> includedSprites;
|
||||
|
||||
for (auto& item : m_documents) {
|
||||
if (firstDoc)
|
||||
firstDoc = false;
|
||||
else
|
||||
os << ",";
|
||||
|
||||
Doc* doc = item.doc;
|
||||
Sprite* sprite = doc->sprite();
|
||||
|
||||
// Avoid including the same document more than once
|
||||
if (includedSprites.find(sprite->id()) != includedSprites.end())
|
||||
continue;
|
||||
includedSprites.insert(sprite->id());
|
||||
|
||||
os << "\n { \"name\": \"" << doc->name() << "\"" << sprite->userData() << " }";
|
||||
}
|
||||
|
||||
os << "\n ]";
|
||||
}
|
||||
|
||||
// meta.frameTags
|
||||
if (m_listTags) {
|
||||
os << ",\n"
|
||||
|
Loading…
x
Reference in New Issue
Block a user