From 036a632bf5f239ca021d18bd1726346cc7a3fcbd Mon Sep 17 00:00:00 2001 From: Ivan Mahonin Date: May 01 2023 08:50:56 +0000 Subject: #assistants: fix TAngleRangeSet::Iterator --- diff --git a/toonz/sources/common/tgeometry/tgeometry.cpp b/toonz/sources/common/tgeometry/tgeometry.cpp index 609b0fd..5c2b704 100644 --- a/toonz/sources/common/tgeometry/tgeometry.cpp +++ b/toonz/sources/common/tgeometry/tgeometry.cpp @@ -368,6 +368,10 @@ TAffine4 TAffine4::rotationZ(double angle) { //================================================================================================== +TAngleRangeSet::List::const_iterator TAngleRangeSet::Iterator::empty_iterator() { + static List list; + return list.end(); +} int TAngleRangeSet::find(Type a) const { assert(!m_angles.empty()); diff --git a/toonz/sources/include/tgeometry.h b/toonz/sources/include/tgeometry.h index e40191c..80b7376 100644 --- a/toonz/sources/include/tgeometry.h +++ b/toonz/sources/include/tgeometry.h @@ -1367,6 +1367,8 @@ public: List::const_iterator m_current; bool m_lapped; + static List::const_iterator empty_iterator(); + public: inline Iterator(): m_flip(), m_lapped(true) { reset(); } @@ -1377,7 +1379,7 @@ public: inline Iterator& set(bool full) { m_flip = full; m_lapped = !m_flip; - m_current = m_prebegin = m_begin = m_end = List::const_iterator(); + m_current = m_prebegin = m_begin = m_end = empty_iterator(); return *this; }