Trait geometry::place::PlaceBbox

source ·
pub trait PlaceBbox: PlaceBboxMut + Sized {
    // Provided method
    fn place_bbox(self, mode: PlaceMode, pt: Point) -> Self { ... }
}
Expand description

A geometric shape that can be placed at a point using its bounding box.

§Examples

let mut rect1 = Rect::from_sides(0, 0, 100, 200);
assert_eq!(
    rect1.place_bbox(PlaceMode::Center, Point::new(25, 25)),
    Rect::from_sides(-25, -75, 75, 125),
);

Provided Methods§

source

fn place_bbox(self, mode: PlaceMode, pt: Point) -> Self

Places an object at the given point using its boudning box.

For center alignments, the center’s non-integer coordinates are rounded down to the nearest integer. This behavior is subject to change and should not be relied upon.

Creates a new shape at the placed location.

Object Safety§

This trait is not object safe.

Implementors§