pub struct Tree {
pub size: Size,
pub view_box: ViewBox,
pub content_area: Option<Rect>,
/* private fields */
}
Expand description
A render tree.
Fields§
§size: Size
Image size.
Size of an image that should be created to fit the SVG.
width
and height
in SVG.
view_box: ViewBox
SVG viewbox.
Specifies which part of the SVG image should be rendered.
viewBox
and preserveAspectRatio
in SVG.
content_area: Option<Rect>
Content area.
A bounding box of all elements. Includes strokes and filter regions.
Can be None
when the tree has no children.
Implementations§
source§impl Tree
impl Tree
sourcepub fn from_usvg(tree: &Tree) -> Self
pub fn from_usvg(tree: &Tree) -> Self
Creates a rendering tree from [usvg::Tree
].
Text nodes should be already converted into paths using
[usvg::TreeTextToPath::convert_text
].
sourcepub fn from_usvg_node(node: &Node) -> Option<Self>
pub fn from_usvg_node(node: &Node) -> Option<Self>
Creates a rendering tree from [usvg::Node
].
Text nodes should be already converted into paths using
[usvg::TreeTextToPath::convert_text
].
Returns None
when node
has a zero size.
Auto Trait Implementations§
impl !RefUnwindSafe for Tree
impl !Send for Tree
impl !Sync for Tree
impl Unpin for Tree
impl !UnwindSafe for Tree
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