Trait geometry::align::AlignBboxMut
source · pub trait AlignBboxMut: AlignRectMut + Bbox {
// Provided method
fn align_bbox_mut(&mut self, mode: AlignMode, other: impl Bbox, offset: i64) { ... }
}
Expand description
A geometric shape that can be aligned with another shape using their bounding boxes.
§Examples
let mut rect1 = Rect::from_sides(0, 0, 100, 200);
let rect2 = Rect::from_sides(500, 600, 700, 700);
rect1.align_bbox_mut(AlignMode::Left, rect2, 0);
assert_eq!(rect1.left(), rect2.left());
assert_eq!(rect1, Rect::from_sides(500, 0, 600, 200));
Provided Methods§
sourcefn align_bbox_mut(&mut self, mode: AlignMode, other: impl Bbox, offset: i64)
fn align_bbox_mut(&mut self, mode: AlignMode, other: impl Bbox, offset: i64)
Align self
using its bounding box and the bounding box of other
.
offset
represents an offset from the base alignment in the positive direction
along the alignment axis.
For center alignments, if the centers are a non-integer number of units apart, the translation amount is rounded down to the nearest integer. This behavior is subject to change and should not be relied upon.
Object Safety§
This trait is not object safe.