pub struct ViewBox {
pub min_x: SvgInteger,
pub min_y: SvgInteger,
pub width: SvgInteger,
pub height: SvgInteger,
}
Expand description
The viewBox attribute defines the position and dimension, in user space, of an SVG viewport.
The value of the viewBox attribute is a list of four numbers: min-x, min-y, width and height. The numbers, which are separated by whitespace and/or a comma, specify a rectangle in user space which is mapped to the bounds of the viewport established for the associated SVG element (not the browser viewport).
A viewBox can be constructed out of a tuple:
let view_box: svgplot::ViewBox = (1, 2, 3, 4).into();
assert_eq!(view_box.min_x, 1);
assert_eq!(view_box.min_y, 2);
assert_eq!(view_box.width, 3);
assert_eq!(view_box.height, 4);
Fields§
§min_x: SvgInteger
§min_y: SvgInteger
§width: SvgInteger
§height: SvgInteger
Trait Implementations§
source§impl From<(i64, i64, i64, i64)> for ViewBox
impl From<(i64, i64, i64, i64)> for ViewBox
source§fn from(value: (SvgInteger, SvgInteger, SvgInteger, SvgInteger)) -> Self
fn from(value: (SvgInteger, SvgInteger, SvgInteger, SvgInteger)) -> Self
Converts to this type from the input type.