Trait Rectangled

Source
pub trait Rectangled: Sized {
    // Required methods
    fn margin(self, m: Scalar) -> Self;
    fn rel(self, x: Scalar, y: Scalar) -> Self;

    // Provided method
    fn expand(self, m: Scalar) -> Self { ... }
}
Expand description

Should be implemented by contexts that have rectangle information.

Required Methods§

Source

fn margin(self, m: Scalar) -> Self

Shrinks the current rectangle equally by all sides.

Source

fn rel(self, x: Scalar, y: Scalar) -> Self

Moves to a relative rectangle using the current rectangle as tile.

Provided Methods§

Source

fn expand(self, m: Scalar) -> Self

Expands the current rectangle equally by all sides.

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§