Skip to main content

clamped_block_title_position

Function clamped_block_title_position 

Source
pub fn clamped_block_title_position(
    bbox: Rect,
    title: &ShapeLabel<'_>,
    text_width: f32,
) -> (Pos2, Align2)
Expand description

Like block_title_position, but clamps the horizontal offset so a title of width text_width stays within the block (pinning flush when wider). Used at draw time so a later resize can’t leave a stale offset drawing outside the block.