diff --git a/src/app/doc_exporter.cpp b/src/app/doc_exporter.cpp index 3244d7009..925fde0e0 100644 --- a/src/app/doc_exporter.cpp +++ b/src/app/doc_exporter.cpp @@ -603,7 +603,6 @@ void DocExporter::reset() m_listLayers = false; m_listSlices = false; m_documents.clear(); - m_tagDelta.clear(); } void DocExporter::setDocImageBuffer(const doc::ImageBufferPtr& docBuf) @@ -961,15 +960,8 @@ void DocExporter::captureSamples(Samples& samples, // Should we ignore this empty frame? (i.e. don't include // the frame in the sprite sheet) - if (m_ignoreEmptyCels) { - for (Tag* tag : sprite->tags()) { - auto& delta = m_tagDelta[tag->id()]; - - if (frame < tag->fromFrame()) --delta.first; - if (frame <= tag->toFrame()) --delta.second; - } + if (m_ignoreEmptyCels) continue; - } // Create an entry with Size(1, 1) for this completely // trimmed frame anyway so we conserve the frame information @@ -1340,13 +1332,9 @@ void DocExporter::createDataFile(const Samples& samples, else os << ","; - std::pair delta(0, 0); - if (!m_tagDelta.empty()) - delta = m_tagDelta[tag->id()]; - os << "\n { \"name\": \"" << escape_for_json(tag->name()) << "\"," - << " \"from\": " << (tag->fromFrame()+delta.first) << "," - << " \"to\": " << (tag->toFrame()+delta.second) << "," + << " \"from\": " << (tag->fromFrame()) << "," + << " \"to\": " << (tag->toFrame()) << "," << " \"direction\": \"" << escape_for_json(convert_anidir_to_string(tag->aniDir())) << "\" }"; } } diff --git a/src/app/doc_exporter.h b/src/app/doc_exporter.h index 3a39a514f..c3b462d17 100644 --- a/src/app/doc_exporter.h +++ b/src/app/doc_exporter.h @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2019 Igara Studio S.A. +// Copyright (C) 2019-2022 Igara Studio S.A. // Copyright (C) 2001-2018 David Capello // // This program is distributed under the terms of @@ -21,7 +21,6 @@ #include "gfx/rect.h" #include -#include #include #include #include @@ -163,11 +162,6 @@ namespace app { bool m_listSlices; Items m_documents; - // Displacement for each tag from/to frames in case we export - // them. It's used in case we trim frames outside tags and they - // will not be exported at all in the final result. - std::map > m_tagDelta; - // Buffers used doc::ImageBufferPtr m_docBuf; doc::ImageBufferPtr m_sampleBuf;