[][src]Trait resvg::RectExt

pub trait RectExt: Sized {
    fn new_bbox() -> Self;
fn expand(&mut self, r: Rect);
fn bbox_transform(&self, bbox: Rect) -> Option<Self>;
fn transform(&self, ts: &Transform) -> Self;
fn to_screen_size(&self) -> ScreenSize;
fn to_screen_rect(&self) -> ScreenRect; }

Additional Rect methods.

Required methods

fn new_bbox() -> Self

Creates a new Rect for bounding box calculation.

Shorthand for Rect::new(f64::MAX, f64::MAX, 1.0, 1.0).

fn expand(&mut self, r: Rect)

Expands the Rect to the provided size.

fn bbox_transform(&self, bbox: Rect) -> Option<Self>

Transforms the Rect using the provided bbox.

fn transform(&self, ts: &Transform) -> Self

Transforms the Rect using the provided Transform.

This method is expensive.

fn to_screen_size(&self) -> ScreenSize

Returns rect's size in screen units.

fn to_screen_rect(&self) -> ScreenRect

Returns rect in screen units.

Loading content...

Implementors

impl RectExt for Rect[src]

Loading content...