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: SvgIntegerTrait 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.
Auto Trait Implementations§
impl Freeze for ViewBox
impl RefUnwindSafe for ViewBox
impl Send for ViewBox
impl Sync for ViewBox
impl Unpin for ViewBox
impl UnwindSafe for ViewBox
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more