mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 16:16:43 +00:00
LibWeb: Implement missing CanvasPath::moveTo()
steps
This commit is contained in:
parent
2874380849
commit
6128a28f17
Notes:
sideshowbarker
2024-07-17 08:36:27 +09:00
Author: https://github.com/MacDue
Commit: 6128a28f17
Pull-request: https://github.com/SerenityOS/serenity/pull/23660
1 changed files with 6 additions and 0 deletions
|
@ -22,8 +22,14 @@ void CanvasPath::close_path()
|
||||||
m_path.close();
|
m_path.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-moveto
|
||||||
void CanvasPath::move_to(float x, float y)
|
void CanvasPath::move_to(float x, float y)
|
||||||
{
|
{
|
||||||
|
// 1. If either of the arguments are infinite or NaN, then return.
|
||||||
|
if (!isfinite(x) || !isfinite(y))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// 2. Create a new subpath with the specified point as its first (and only) point.
|
||||||
m_path.move_to(active_transform().map(Gfx::FloatPoint { x, y }));
|
m_path.move_to(active_transform().map(Gfx::FloatPoint { x, y }));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue