[][src]Trait usvg::NodeExt

pub trait NodeExt {
    fn id(&self) -> Ref<str>;
fn transform(&self) -> Transform;
fn abs_transform(&self) -> Transform;
fn units(&self) -> Option<Units>;
fn append_kind(&mut self, kind: NodeKind) -> Node;
fn tree(&self) -> Tree;
fn calculate_bbox(&self) -> Option<Rect>; }

Additional Node methods.

Required methods

fn id(&self) -> Ref<str>

Returns node's ID.

If a current node doesn't support ID - an empty string will be returned.

fn transform(&self) -> Transform

Returns node's transform.

If a current node doesn't support transformation - a default transform will be returned.

fn abs_transform(&self) -> Transform

Returns node's absolute transform.

If a current node doesn't support transformation - a default transform will be returned.

fn units(&self) -> Option<Units>

Returns node's paint server units.

Returns None when node is not a LinearGradient, RadialGradient or Pattern.

fn append_kind(&mut self, kind: NodeKind) -> Node

Appends kind as a node child.

Shorthand for Node::append(Node::new(Box::new(kind))).

fn tree(&self) -> Tree

Returns a node's tree.

fn calculate_bbox(&self) -> Option<Rect>

Calculates node's absolute bounding box.

Can be expensive on large paths and groups.

Loading content...

Implementors

impl NodeExt for Node[src]

Loading content...