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

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

Should be implemented by contexts that have rectangle information.

Required Methods§

source

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

Shrinks the current rectangle equally by all sides.

source

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

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

Provided Methods§

source

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

Expands the current rectangle equally by all sides.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Rectangled for [f64; 4]

source§

fn margin(self, m: f64) -> [f64; 4]

source§

fn rel(self, x: f64, y: f64) -> [f64; 4]

Implementors§