Trait figures::ScreenScale
source · pub trait ScreenScale {
type Px;
type UPx;
type Lp;
// Required methods
fn into_px(self, scale: Fraction) -> Self::Px;
fn from_px(px: Self::Px, scale: Fraction) -> Self;
fn into_upx(self, scale: Fraction) -> Self::UPx;
fn from_upx(px: Self::UPx, scale: Fraction) -> Self;
fn into_lp(self, scale: Fraction) -> Self::Lp;
fn from_lp(lp: Self::Lp, scale: Fraction) -> Self;
}
Required Associated Types§
Required Methods§
sourcefn into_px(self, scale: Fraction) -> Self::Px
fn into_px(self, scale: Fraction) -> Self::Px
Converts this value from its current unit into device pixels (Px
)
using the provided scale
factor.
sourcefn from_px(px: Self::Px, scale: Fraction) -> Self
fn from_px(px: Self::Px, scale: Fraction) -> Self
Converts from pixels into this type, using the provided scale
factor.
sourcefn into_upx(self, scale: Fraction) -> Self::UPx
fn into_upx(self, scale: Fraction) -> Self::UPx
Converts this value from its current unit into device pixels
(UPx
) using the provided scale
factor.
sourcefn from_upx(px: Self::UPx, scale: Fraction) -> Self
fn from_upx(px: Self::UPx, scale: Fraction) -> Self
Converts from unsigned pixels into this type, using the provided scale
factor.
Object Safety§
This trait is not object safe.