Struct svgplot::view_box::ViewBox

source ·
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§

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.