pub trait Position: Sized {
// Required methods
fn bbox(&self) -> Option<Rect>;
fn transform(self, a: Affine) -> Self;
// Provided methods
fn next_to(self, other: &impl Position, dir: Vec2, buff: f64) -> Self { ... }
fn align_to(self, other: &impl Position, dir: Vec2) -> Self { ... }
fn to_edge(self, dir: Vec2) -> Self { ... }
}Expand description
Something that can be placed relative to other things by its bounding box. Empty things (no bounding box) are left where they are.
Required Methods§
Provided Methods§
Sourcefn next_to(self, other: &impl Position, dir: Vec2, buff: f64) -> Self
fn next_to(self, other: &impl Position, dir: Vec2, buff: f64) -> Self
Places this buff units from other in direction dir, centered on it along the other
axis, manim’s next_to (e.g. label.next_to(&dot, UP, DEFAULT_BUFF)). A diagonal
dir places it off a corner.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".