mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibWeb: Fix Skia painter to close paths more correctly
Start point was incorrectly passed into `close_subpath_if_needed()` as end point, which led to all subpaths being closed.
This commit is contained in:
parent
2248ea1ae3
commit
330d5996ed
Notes:
sideshowbarker
2024-07-17 22:09:47 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/330d5996ed Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/329
1 changed files with 3 additions and 3 deletions
|
@ -143,11 +143,10 @@ static SkPath to_skia_path(Gfx::Path const& path)
|
|||
};
|
||||
for (auto const& segment : path) {
|
||||
auto point = segment.point();
|
||||
subpath_last_point = point;
|
||||
switch (segment.command()) {
|
||||
case Gfx::PathSegment::Command::MoveTo: {
|
||||
if (subpath_start_point.has_value())
|
||||
close_subpath_if_needed(subpath_start_point.value());
|
||||
if (subpath_start_point.has_value() && subpath_last_point.has_value())
|
||||
close_subpath_if_needed(subpath_last_point.value());
|
||||
subpath_start_point = point;
|
||||
path_builder.moveTo({ point.x(), point.y() });
|
||||
break;
|
||||
|
@ -178,6 +177,7 @@ static SkPath to_skia_path(Gfx::Path const& path)
|
|||
default:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
subpath_last_point = point;
|
||||
}
|
||||
|
||||
close_subpath_if_needed(subpath_last_point);
|
||||
|
|
Loading…
Reference in a new issue