We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ddbc9dc commit 625bc4cCopy full SHA for 625bc4c
src/vector/vbezier.cpp
@@ -81,12 +81,12 @@ float VBezier::tAtLength(float l, float totalLength) const
81
t *= 0.5;
82
83
float lastBigger = 1.0;
84
- while (1) {
+ for (int num = 0; num < 100500; num++) {
85
VBezier right = *this;
86
VBezier left;
87
right.parameterSplitLeft(t, &left);
88
float lLen = left.length();
89
- if (fabs(lLen - l) < error) break;
+ if (fabs(lLen - l) < error) return t;
90
91
if (lLen < l) {
92
t += (lastBigger - t) * 0.5f;
@@ -95,6 +95,7 @@ float VBezier::tAtLength(float l, float totalLength) const
95
t -= t * 0.5f;
96
}
97
98
+ vWarning << "no convergence";
99
return t;
100
101
0 commit comments