Magnum::Ui::Anchor class

Anchor.

Specifies widget position relative to the plane or another widget.

Constructors, destructors, conversion operators

Anchor(Snaps snaps, const Range2D& rect)
Anchor relative to plane or user interface.
Anchor(Snaps snaps, const Vector2& size = {})
Anchor()
Anchor(Snaps snaps, const Widget& widget, const Range2D& rect)
Anchor relative to another widget.
Anchor(Snaps snaps, const Widget& widget, const Vector2& size = {})

Public functions

auto rect(const AbstractPlane& plane) const -> Range2D
Calculate final anchor rectangle relative to a plane.
auto rect(const AbstractUserInterface& ui) const -> Range2D
Calculate final anchor rectangle relative to an user interface.

Function documentation

Magnum::Ui::Anchor::Anchor(Snaps snaps, const Range2D& rect)

Anchor relative to plane or user interface.

Snap::InsideX and Snap::InsideY is used implicitly.

Magnum::Ui::Anchor::Anchor(Snaps snaps, const Vector2& size = {})

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Magnum::Ui::Anchor::Anchor()

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Equivalent to Anchor{{}}.

Magnum::Ui::Anchor::Anchor(Snaps snaps, const Widget& widget, const Vector2& size = {})

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Range2D Magnum::Ui::Anchor::rect(const AbstractPlane& plane) const

Calculate final anchor rectangle relative to a plane.

Takes plane size, margin and padding into account.

Range2D Magnum::Ui::Anchor::rect(const AbstractUserInterface& ui) const

Calculate final anchor rectangle relative to an user interface.

Takes user interface size into account.