[−][src]Trait druid::Scalable
The Scalable
trait describes how coordinates should be translated
from display points into pixels and vice versa using a Scale
.
Required methods
pub fn to_px(&self, scale: Scale) -> Self
[src]
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.
pub fn to_dp(&self, scale: Scale) -> Self
[src]
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
[src]
pub fn to_px(&self, scale: Scale) -> Line
[src]
Converts a Line
from display points into pixels,
using the x axis scale factor for x
and the y axis scale factor for y
.
pub fn to_dp(&self, scale: Scale) -> Line
[src]
Converts a Line
from pixels into display points,
using the x axis scale factor for x
and the y axis scale factor for y
.
impl Scalable for Insets
[src]
pub fn to_px(&self, scale: Scale) -> Insets
[src]
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
.
pub fn to_dp(&self, scale: Scale) -> Insets
[src]
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
.
impl Scalable for Point
[src]
pub fn to_px(&self, scale: Scale) -> Point
[src]
Converts a Point
from display points into pixels,
using the x axis scale factor for x
and the y axis scale factor for y
.
pub fn to_dp(&self, scale: Scale) -> Point
[src]
Converts a Point
from pixels into display points,
using the x axis scale factor for x
and the y axis scale factor for y
.
impl Scalable for Rect
[src]
pub fn to_px(&self, scale: Scale) -> Rect
[src]
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
.
pub fn to_dp(&self, scale: Scale) -> Rect
[src]
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
.
impl Scalable for Size
[src]
pub fn to_px(&self, scale: Scale) -> Size
[src]
Converts a Size
from display points into pixels,
using the x axis scale factor for width
and the y axis scale factor for height
.
pub fn to_dp(&self, scale: Scale) -> Size
[src]
Converts a Size
from pixels into points,
using the x axis scale factor for width
and the y axis scale factor for height
.
impl Scalable for Vec2
[src]
pub fn to_px(&self, scale: Scale) -> Vec2
[src]
Converts a Vec2
from display points into pixels,
using the x axis scale factor for x
and the y axis scale factor for y
.
pub fn to_dp(&self, scale: Scale) -> Vec2
[src]
Converts a Vec2
from pixels into display points,
using the x axis scale factor for x
and the y axis scale factor for y
.