Skip to main content

viewbox_meet_transform

Function viewbox_meet_transform 

Source
pub fn viewbox_meet_transform(
    view_box: ViewBox,
    vw: f32,
    vh: f32,
) -> AffineTransform
Expand description

Builds the transform mapping viewBox coordinates into a viewport using xMidYMid meet (the SVG default: fit the whole box inside the viewport, centered). Without a usable viewBox, coordinates map 1:1.