pub enum OverlayAnchor {
Owner,
Rect(Rect),
}Expand description
The overlay-portal authoring surface: the slot a widget that floats its own surface holds, what that surface is anchored to, and the placement geometry every anchored pattern needs.
Promoted here rather than left to each design system because all three of
them had derived the same geometry independently: a design system’s popover,
menu, tooltip and context menu place a surface through place and host it
through OverlaySlot, reaching both through frust::authoring alone.
The overlay-portal authoring surface: the slot a widget that floats its own
surface holds, what that surface is anchored to, and the placement geometry
every anchored pattern needs.
Promoted here rather than left to each design system because all three of
them had derived the same geometry independently: a design system’s popover,
menu, tooltip and context menu place a surface through place and host it
through OverlaySlot, reaching both through frust::authoring alone.
The overlay-portal authoring surface: the slot a widget that floats its own
surface holds, what that surface is anchored to, and the placement geometry
every anchored pattern needs.
Promoted here rather than left to each design system because all three of
them had derived the same geometry independently: a design system’s popover,
menu, tooltip and context menu place a surface through place and host it
through OverlaySlot, reaching both through frust::authoring alone.
What a slot places its surface against.
Both variants resolve to a window-space rect in the owner’s paint,
where the owner’s absolute origin is finally known; nothing is subscribed to
and nothing is cached across frames, so an anchor follows its owner across
scroll, relayout and animation for free.
Variants§
Owner
The owner’s own bounds — a trigger floating a menu under itself.
Rect(Rect)
A rect in the owner’s local space: a caret, a selection’s bounding
box, a press point, one row of a list. Translated by the owner’s paint
origin, so a caller states it in the same coordinates its layout and
event already speak.