Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

fix(level-strip): show correct thumbnails after frames are inserted or moved

Ahl76a1f392e27d1a
diff --git a/toonz/sources/include/toonz/txshsimplelevel.h b/toonz/sources/include/toonz/txshsimplelevel.h
index e730b7848..4abfef042 100644
--- a/toonz/sources/include/toonz/txshsimplelevel.h
+++ b/toonz/sources/include/toonz/txshsimplelevel.h
@@ -287,6 +287,8 @@ public:
//! must have the same size).
void renumber(const std::vector<TFrameId> &fids);
+ int getRenumberCount() const { return m_renumberCount; }
+
bool isFrameReadOnly(TFrameId fid);
public:
@@ -349,6 +351,7 @@ private:
TPaletteP m_palette;
FramesSet m_frames;
+ int m_renumberCount = 0;
std::map<TFrameId, TFrameId>
m_renumberTable; //!< Maps disk-frames to level-frames.
diff --git a/toonz/sources/toonzlib/txshsimplelevel.cpp b/toonz/sources/toonzlib/txshsimplelevel.cpp
index 952025a0d..bbc89c772 100644
--- a/toonz/sources/toonzlib/txshsimplelevel.cpp
+++ b/toonz/sources/toonzlib/txshsimplelevel.cpp
@@ -2097,6 +2097,7 @@ void TXshSimpleLevel::renumber(const std::vector<TFrameId>& fids) {
assert(m_frames.count(fid) == 0);
m_frames.insert(fid);
}
+ ++m_renumberCount;
ImageManager* im = ImageManager::instance();
TImageCache* ic = TImageCache::instance();
diff --git a/toonz/sources/toonzqt/icongenerator.cpp b/toonz/sources/toonzqt/icongenerator.cpp
index 5d5c340ea..936b1618e 100644
--- a/toonz/sources/toonzqt/icongenerator.cpp
+++ b/toonz/sources/toonzqt/icongenerator.cpp
@@ -171,10 +171,10 @@ void removeIcon(const std::string &iconName) {
//-----------------------------------------------------------------------------
-std::string responsiveIconKey(const std::string &baseId,
- const TDimension &size) {
+std::string responsiveIconKey(const std::string &baseId, const TDimension &size,
+ int renumberCount) {
return baseId + "_r_" + std::to_string(size.lx) + "x" +
- std::to_string(size.ly);
+ std::to_string(size.ly) + "_" + std::to_string(renumberCount);
}
std::string filmstripIconBaseId(TXshSimpleLevel *sl, const TFrameId &fid) {
@@ -1640,7 +1640,8 @@ QPixmap IconGenerator::getResponsiveIcon(TXshLevel *xl, const TFrameId &fid,
if (!sl) return QPixmap();
const std::string baseId = filmstripIconBaseId(sl, fid);
- const std::string key = responsiveIconKey(baseId, dim);
+ const std::string key =
+ responsiveIconKey(baseId, dim, sl->getRenumberCount());
retainResponsiveIcon(baseId, key);
return getSizedIcon(xl, fid, key.substr(baseId.size()), dim);
}