mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-08 12:56:23 +03: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: https://github.com/SerenityOS/serenity/commit/6128a28f17 Pull-request: https://github.com/SerenityOS/serenity/pull/23660
@ -22,8 +22,14 @@ void CanvasPath::close_path()
|
||||
m_path.close();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-moveto
|
||||
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 }));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user