Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2014-06-04 09:51:39 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2014-06-04 10:03:42 +0400
commit812515b623be9179e67d97b84b10df587244d38c (patch)
tree92e11d33c238075686759b0b093d3b1d516121a7 /source/blender/freestyle/intern/stroke/Stroke.h
parent5ee55caba58371d06e6437a493a93bdec804be45 (diff)
Freestyle: Fix for a potential infinite loop in stroke resampling by vertex count.
Changes were made in Stroke::Resample(int) in C++ to prevent a potential infinite loop caused by an inconsistency between Stroke::_Length and the stroke length computed based on stroke vertices. Such a stroke length inconsistency is usually caused by missing calls of Stroke::UpdateLength() (i.e., API implementation bugs), but also may occur due to scripting errors in user-defined style modules. This commit is meant to help script writters to identify the latter error cases. Now Stroke.resample(int) may raise a runtime error to signal an error condition.
Diffstat (limited to 'source/blender/freestyle/intern/stroke/Stroke.h')
-rw-r--r--source/blender/freestyle/intern/stroke/Stroke.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/freestyle/intern/stroke/Stroke.h b/source/blender/freestyle/intern/stroke/Stroke.h
index 5e6c2fcf6cb..abbbcc32750 100644
--- a/source/blender/freestyle/intern/stroke/Stroke.h
+++ b/source/blender/freestyle/intern/stroke/Stroke.h
@@ -588,7 +588,7 @@ public:
* \param iNPoints
* The number of vertices we eventually want in our stroke.
*/
- void Resample(int iNPoints);
+ int Resample(int iNPoints);
/*! Resampling method.
* Resamples the curve with a given sampling.
@@ -596,7 +596,7 @@ public:
* \param iSampling
* The new sampling value.
*/
- void Resample(float iSampling);
+ int Resample(float iSampling);
/*! Removes all vertices from the Stroke.
*/