mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-20 06:59:47 +00:00
LibWeb: Do nothing when calling CanvasPath.closePath()
with empty path
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
This commit is contained in:
parent
a125bc97c4
commit
3c6472dc00
Notes:
github-actions[bot]
2025-09-06 12:48:46 +00:00
Author: https://github.com/tcl3
Commit: 3c6472dc00
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6094
3 changed files with 31 additions and 0 deletions
|
@ -23,8 +23,14 @@ void CanvasPath::ensure_subpath(float x, float y)
|
|||
m_path.move_to(Gfx::FloatPoint { x, y });
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-closepath
|
||||
void CanvasPath::close_path()
|
||||
{
|
||||
// The closePath() method, when invoked, must do nothing if the object's path has no subpaths. Otherwise, it must
|
||||
// mark the last subpath as closed, create a new subpath whose first point is the same as the previous subpath's
|
||||
// first point, and finally add this new subpath to the path.
|
||||
if (m_path.is_empty())
|
||||
return;
|
||||
m_path.close();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue