emath::align

Function center_size_in_rect

Source
pub fn center_size_in_rect(size: Vec2, frame: Rect) -> Rect
Expand description

Allocates a rectangle of the specified size inside the frame rectangle around of its center.

If size is bigger than the frames size the returned rect will bounce out of the frame.