Fix loopIndex in chopCubicAtLoopIntersection
A recent change broke the case where the entire bezier is inside the loop segment. Bug: skia:4410 Change-Id: Ib534d459eaa4461d6760e894a8826e3019584ee8 Reviewed-on: https://skia-review.googlesource.com/19333 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
This commit is contained in:
parent
744d3c59be
commit
b58194a90e
@ -837,13 +837,16 @@ int GrPathUtils::chopCubicAtLoopIntersection(const SkPoint src[4], SkPoint dst[1
|
|||||||
t[1] /= s[1];
|
t[1] /= s[1];
|
||||||
SkASSERT(t[0] <= t[1]); // Technically t0 != t1 in a loop, but there may be FP error.
|
SkASSERT(t[0] <= t[1]); // Technically t0 != t1 in a loop, but there may be FP error.
|
||||||
|
|
||||||
if (t[0] > 0 && t[0] < 1) {
|
if (t[0] < 1 && t[1] > 0) {
|
||||||
chops.push_back(t[0]);
|
*loopIndex = 0;
|
||||||
*loopIndex = 1;
|
if (t[0] > 0) {
|
||||||
}
|
chops.push_back(t[0]);
|
||||||
if (t[1] > 0 && t[1] < 1) {
|
*loopIndex = 1;
|
||||||
chops.push_back(t[1]);
|
}
|
||||||
*loopIndex = chops.count() - 1;
|
if (t[1] < 1) {
|
||||||
|
chops.push_back(t[1]);
|
||||||
|
*loopIndex = chops.count() - 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user