mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-12 19:19:30 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
58
Libraries/LibWeb/HTML/Canvas/CanvasPath.h
Normal file
58
Libraries/LibWeb/HTML/Canvas/CanvasPath.h
Normal file
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibGfx/Path.h>
|
||||
#include <LibWeb/Geometry/DOMPointReadOnly.h>
|
||||
#include <LibWeb/HTML/Canvas/CanvasState.h>
|
||||
#include <LibWeb/WebIDL/ExceptionOr.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/canvas.html#canvaspath
|
||||
class CanvasPath {
|
||||
public:
|
||||
~CanvasPath() = default;
|
||||
|
||||
void close_path();
|
||||
|
||||
void move_to(float x, float y);
|
||||
void line_to(float x, float y);
|
||||
void quadratic_curve_to(float cx, float cy, float x, float y);
|
||||
void bezier_curve_to(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y);
|
||||
WebIDL::ExceptionOr<void> arc_to(double x1, double y1, double x2, double y2, double radius);
|
||||
void rect(double x, double y, double w, double h);
|
||||
WebIDL::ExceptionOr<void> round_rect(double x, double y, double w, double h, Variant<double, Geometry::DOMPointInit, Vector<Variant<double, Geometry::DOMPointInit>>> radii = { 0 });
|
||||
WebIDL::ExceptionOr<void> arc(float x, float y, float radius, float start_angle, float end_angle, bool counter_clockwise);
|
||||
WebIDL::ExceptionOr<void> ellipse(float x, float y, float radius_x, float radius_y, float rotation, float start_angle, float end_angle, bool counter_clockwise);
|
||||
|
||||
Gfx::Path& path() { return m_path; }
|
||||
Gfx::Path const& path() const { return m_path; }
|
||||
|
||||
protected:
|
||||
explicit CanvasPath(Bindings::PlatformObject& self)
|
||||
: m_self(self)
|
||||
{
|
||||
}
|
||||
|
||||
explicit CanvasPath(Bindings::PlatformObject& self, CanvasState const& canvas_state)
|
||||
: m_self(self)
|
||||
, m_canvas_state(canvas_state)
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
Gfx::AffineTransform active_transform() const;
|
||||
|
||||
void ensure_subpath(float x, float y);
|
||||
|
||||
JS::NonnullGCPtr<Bindings::PlatformObject> m_self;
|
||||
Optional<CanvasState const&> m_canvas_state;
|
||||
Gfx::Path m_path;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue