mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 10:22:05 -05:00
LibGUI: Allow creating margins from arrays
This is necessary for upcoming GML -> C++ compilation.
This commit is contained in:
parent
9101c8d079
commit
ea0ab87b88
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