substrate::geometry::prelude

Trait PlaceBbox

Source
pub trait PlaceBbox: Sized + PlaceBboxMut {
    // 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> PlaceBbox for T
where T: PlaceBboxMut,