pub trait Scalable {
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.
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.
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.
Converts a Vec2 from display points into pixels,
using the x axis scale factor for x and the y axis scale factor for y.
Converts a Vec2 from pixels into display points,
using the x axis scale factor for x and the y axis scale factor for y.
Converts a Point from display points into pixels,
using the x axis scale factor for x and the y axis scale factor for y.
Converts a Point from pixels into display points,
using the x axis scale factor for x and the y axis scale factor for y.
Converts a Line from display points into pixels,
using the x axis scale factor for x and the y axis scale factor for y.
Converts a Line from pixels into display points,
using the x axis scale factor for x and the y axis scale factor for y.
Converts a Size from display points into pixels,
using the x axis scale factor for width
and the y axis scale factor for height.
Converts a Size from pixels into points,
using the x axis scale factor for width
and the y axis scale factor for height.
Converts a Rect from display points into pixels,
using the x axis scale factor for x0 and x1
and the y axis scale factor for y0 and y1.
Converts a Rect from pixels into display points,
using the x axis scale factor for x0 and x1
and the y axis scale factor for y0 and y1.
Converts Insets from display points into pixels,
using the x axis scale factor for x0 and x1
and the y axis scale factor for y0 and y1.
Converts Insets from pixels into display points,
using the x axis scale factor for x0 and x1
and the y axis scale factor for y0 and y1.