Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Libraries/LibGfx/PathSkia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,11 @@ Gfx::FloatRect PathImplSkia::bounding_box() const
float PathImplSkia::length() const
{
SkPathMeasure path_measure(sk_path(), false);
return path_measure.getLength();
float length = 0;
do {
length += path_measure.getLength();
} while (path_measure.nextContour());
return length;
}

bool PathImplSkia::contains(FloatPoint point, Gfx::WindingRule winding_rule) const
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
120
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!doctype html>
<script src="../include.js"></script>
<svg xmlns="http://www.w3.org/2000/svg">
<path id="path" d="M0 0 h 10 v 10 H 0 z M 20 0 h 20 v 20 H 20 z" />
</svg>
<script>
test(() => {
println(document.getElementById("path").getTotalLength());
});
</script>