Fix issue with offsetting polygon by 0 distance.

Need to output matching indices as well.

Bug: skia:13417, chromium:937412
Change-Id: I251a70eb07fda8b3a257d9f57ebdd9f20ad01b5a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197160
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This commit is contained in:
Jim Van Verth 2019-03-04 14:10:34 -05:00 committed by Skia Commit-Bot
parent 8c48f022eb
commit 6e8174e957

View File

@ -1164,6 +1164,7 @@ bool SkOffsetSimplePolygon(const SkPoint* inputPolygonVerts, int inputPolygonSiz
if (SkScalarNearlyZero(offset)) {
for (int i = 0; i < inputPolygonSize; ++i) {
*offsetPolygon->push() = inputPolygonVerts[i];
*polygonIndices->push() = i;
}
return true;
}