Skip to content

Commit

Permalink
Merge pull request #158 from sherlockdoyle/patch-1
Browse files Browse the repository at this point in the history
fixes #157
  • Loading branch information
kyamagu committed Nov 17, 2021
2 parents 226609d + 4b4fdc9 commit 805223f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/skia/Path.cpp
Expand Up @@ -701,7 +701,9 @@ path
py::arg("index"))
.def("getPoints",
[] (const SkPath& path, int max) {
std::vector<SkPoint> points((max == 0) ? path.countPoints() : max);
if (max == 0)
max = path.countVerbs();
std::vector<SkPoint> points(max);
auto length = path.getPoints(&points[0], max);
if (length < max)
points.erase(points.begin() + length, points.end());
Expand Down

0 comments on commit 805223f

Please sign in to comment.