diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-09-02 16:24:41 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-09-02 16:24:41 +0400 |
commit | f6b4b1296125d43e94968709bc52d5f7a062734e (patch) | |
tree | 53a2040bb5b9a3284499c1029ce2ded46c0a6c84 /source/blender/freestyle/intern/view_map/Interface0D.h | |
parent | 0c1ff4b75b4c856f414eec0526658d0ff38ebf1f (diff) |
Better fix for T41464: Material Boundary bug in Freestyle.
The problem addressed here is that there was no mean to check if an iterator
points the last of the elements being iterated over. Such checking is necessary
to reliably dereference the iterator (i.e., calling the operator*() method of the
underlying C++ iterator object).
Now Interface0DIterator and StrokeVertexIterator have an .at_last property
to check if an iterator points the last element. Using this new API feature,
the present commit partly reverts the previous commit rBeb8964fb7f19 to
better address T41464.
Differential revision: https://developer.blender.org/D752
Author: flokkievids (Folkert de Vries)
Reviewed by: kjym3 (Tamito Kajiyama)
Diffstat (limited to 'source/blender/freestyle/intern/view_map/Interface0D.h')
-rw-r--r-- | source/blender/freestyle/intern/view_map/Interface0D.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/freestyle/intern/view_map/Interface0D.h b/source/blender/freestyle/intern/view_map/Interface0D.h index 123253bf3e1..da71d7ad949 100644 --- a/source/blender/freestyle/intern/view_map/Interface0D.h +++ b/source/blender/freestyle/intern/view_map/Interface0D.h @@ -302,6 +302,18 @@ public: return _iterator->isEnd(); } + /*! Returns true when the iterator is pointing to the final valid element. */ + virtual bool atLast() const + { + if (_iterator->isEnd()) + return false; + + _iterator->increment(); + bool result = _iterator->isEnd(); + _iterator->decrement(); + return result; + } + /*! operator == . */ bool operator==(const Interface0DIterator& it) const { |