Skip to main content

box_rect

Function box_rect 

Source
pub fn box_rect(
    anchor: Pos2,
    size: Option<GridSize>,
    text: &str,
    width: BoxWidth,
) -> Rect
Expand description

The text box’s on-canvas rect from a given anchor. Prefers the cached size (measured from a real galley when the text was last edited) and only falls back to the text_bbox estimate when no measurement exists yet (a freshly created box, or one saved before extents were). anchor is passed in rather than read from the box so callers can shift it during a drag.