pub trait Scalable {
    // Required methods
    fn to_px(&self, scale: Scale) -> Self;
    fn to_dp(&self, scale: Scale) -> Self;
}
Expand description

The Scalable trait describes how coordinates should be translated from display points into pixels and vice versa using a Scale.

Required Methods§

fn to_px(&self, scale: Scale) -> Self

Converts the scalable item from display points into pixels, using the x axis scale factor for coordinates on the x axis and the y axis scale factor for coordinates on the y axis.

fn to_dp(&self, scale: Scale) -> Self

Converts the scalable item from pixels into display points, using the x axis scale factor for coordinates on the x axis and the y axis scale factor for coordinates on the y axis.

Implementors§

§

impl Scalable for Line

§

impl Scalable for Insets

§

impl Scalable for Point

§

impl Scalable for Rect

§

impl Scalable for Size

§

impl Scalable for Vec2