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/stroke | |
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/stroke')
-rw-r--r-- | source/blender/freestyle/intern/stroke/StrokeIterators.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/freestyle/intern/stroke/StrokeIterators.h b/source/blender/freestyle/intern/stroke/StrokeIterators.h index a8ec529fbfa..1df9aa2794a 100644 --- a/source/blender/freestyle/intern/stroke/StrokeIterators.h +++ b/source/blender/freestyle/intern/stroke/StrokeIterators.h @@ -171,6 +171,18 @@ public: return _it == _begin; } + /*! Returns true if the pointed StrokeVertex is the final valid StrokeVertex of the Stroke. */ + bool atLast() + { + if (_it == _end) + return false; + + ++_it; + bool result = (_it == _end); + --_it; + return result; + } + /*! Returns true if the pointed StrokeVertex is after the last StrokeVertex of the Stroke. */ bool isEnd() const { |