LibGUI: Allow creating margins from arrays
This is necessary for upcoming GML -> C++ compilation.
This commit is contained in:
parent
9101c8d079
commit
ea0ab87b88
Notes:
sideshowbarker
2024-07-17 01:21:02 +09:00
Author: https://github.com/kleinesfilmroellchen Commit: https://github.com/SerenityOS/serenity/commit/ea0ab87b88 Pull-request: https://github.com/SerenityOS/serenity/pull/17373 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/BenWiederhake ✅ Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/linusg Reviewed-by: https://github.com/me-minus Reviewed-by: https://github.com/timschumi
1 changed files with 23 additions and 0 deletions
|
@ -42,6 +42,29 @@ public:
|
|||
, m_left(left)
|
||||
{
|
||||
}
|
||||
|
||||
// GML compatibility constructors only for use in auto-generated code.
|
||||
|
||||
explicit Margins(Array<i64, 1> all)
|
||||
: Margins(all[0])
|
||||
{
|
||||
}
|
||||
|
||||
explicit Margins(Array<i64, 2> vertical_horizontal)
|
||||
: Margins(vertical_horizontal[0], vertical_horizontal[1])
|
||||
{
|
||||
}
|
||||
|
||||
explicit Margins(Array<i64, 3> top_horizontal_bottom)
|
||||
: Margins(top_horizontal_bottom[0], top_horizontal_bottom[1], top_horizontal_bottom[2])
|
||||
{
|
||||
}
|
||||
|
||||
explicit Margins(Array<i64, 4> margins)
|
||||
: Margins(margins[0], margins[1], margins[2], margins[3])
|
||||
{
|
||||
}
|
||||
|
||||
~Margins() = default;
|
||||
|
||||
[[nodiscard]] Gfx::IntRect applied_to(Gfx::IntRect const& input) const
|
||||
|
|
Loading…
Add table
Reference in a new issue