|
TinyMaterialDesign
|
Positions a single rect relative to a corner/edge of a container. More...
#include <AnchorLayout.h>
Public Member Functions | |
| AnchorLayout (Bounds container, int32_t margin=0) | |
| Bounds | rect (Anchor anchor, int32_t width, int32_t height) const |
Bounds for a width x height rect anchored at anchor, inset by margin. | |
Positions a single rect relative to a corner/edge of a container.
Not a widget - see GridLayout.h for the rationale. Solves the "place a FAB in the bottom-right" / "badge in the top-right corner of an avatar" cases that would otherwise be hand-computed arithmetic in every sketch:
fab.bounds = AnchorLayout(screenBounds, 16).rect(Anchor::BottomRight, 56, 56); badge.bounds = AnchorLayout(avatar.bounds, 0).rect(Anchor::TopRight, 16, 16);
|
inlineexplicit |
Bounds for a width x height rect anchored at anchor, inset by margin.