[][src]Trait embedded_layout::prelude::RectExt

pub trait RectExt {
    fn with_size(top_left: Point, size: Size) -> Rectangle;
fn center_x(&self) -> i32;
fn center_y(&self) -> i32;
fn center(&self) -> Point;
fn enveloping(&self, other: &Rectangle) -> Rectangle; }

The trait that describes the extension methods.

Required methods

fn with_size(top_left: Point, size: Size) -> Rectangle

Create a new Rectangle from a top left point and a Size

fn center_x(&self) -> i32

Return the horizontal center coordinate

Note: when an object's width is an even number, the returned center point will not be perfectly in the middle.

fn center_y(&self) -> i32

Return the vertical center coordinate

Note: when an object's height is an even number, the returned center point will not be perfectly in the middle.

fn center(&self) -> Point

Return the center point Note: when an object's width or height is an even number, the returned center point will not be perfectly in the middle.

fn enveloping(&self, other: &Rectangle) -> Rectangle

Return the bounding Rectangle that encompasses both Rectangles

Loading content...

Implementations on Foreign Types

impl RectExt for Rectangle[src]

Loading content...

Implementors

Loading content...