pub struct Path {
pub(crate) id: String,
pub(crate) visible: bool,
pub(crate) fill: Option<Fill>,
pub(crate) stroke: Option<Stroke>,
pub(crate) paint_order: PaintOrder,
pub(crate) rendering_mode: ShapeRendering,
pub(crate) data: Arc<Path>,
pub(crate) abs_transform: Transform,
pub(crate) bounding_box: Rect,
pub(crate) abs_bounding_box: Rect,
pub(crate) stroke_bounding_box: Rect,
pub(crate) abs_stroke_bounding_box: Rect,
}Expand description
A path element.
Fields§
§id: String§visible: bool§fill: Option<Fill>§stroke: Option<Stroke>§paint_order: PaintOrder§rendering_mode: ShapeRendering§data: Arc<Path>§abs_transform: Transform§bounding_box: Rect§abs_bounding_box: Rect§stroke_bounding_box: Rect§abs_stroke_bounding_box: RectImplementations§
Source§impl Path
impl Path
pub(crate) fn new_simple(data: Arc<Path>) -> Option<Self>
pub(crate) fn new( id: String, visible: bool, fill: Option<Fill>, stroke: Option<Stroke>, paint_order: PaintOrder, rendering_mode: ShapeRendering, data: Arc<Path>, abs_transform: Transform, ) -> Option<Self>
Sourcepub fn id(&self) -> &str
pub fn id(&self) -> &str
Element’s ID.
Taken from the SVG itself. Isn’t automatically generated. Can be empty.
Sourcepub fn is_visible(&self) -> bool
pub fn is_visible(&self) -> bool
Element visibility.
Sourcepub fn paint_order(&self) -> PaintOrder
pub fn paint_order(&self) -> PaintOrder
Fill and stroke paint order.
Since markers will be replaced with regular nodes automatically,
usvg doesn’t provide the markers order type. It’s was already done.
paint-order in SVG.
Sourcepub fn rendering_mode(&self) -> ShapeRendering
pub fn rendering_mode(&self) -> ShapeRendering
Rendering mode.
shape-rendering in SVG.
Sourcepub fn abs_transform(&self) -> Transform
pub fn abs_transform(&self) -> Transform
Element’s absolute transform.
Contains all ancestors transforms including elements’s transform.
Note that this is not the relative transform present in SVG. The SVG one would be set only on groups.
Sourcepub fn bounding_box(&self) -> Rect
pub fn bounding_box(&self) -> Rect
Element’s object bounding box.
objectBoundingBox in SVG terms. Meaning it doesn’t affected by parent transforms.
Sourcepub fn abs_bounding_box(&self) -> Rect
pub fn abs_bounding_box(&self) -> Rect
Element’s bounding box in canvas coordinates.
userSpaceOnUse in SVG terms.
Sourcepub fn stroke_bounding_box(&self) -> Rect
pub fn stroke_bounding_box(&self) -> Rect
Element’s object bounding box including stroke.
Will have the same value as bounding_box when path has no stroke.
Sourcepub fn abs_stroke_bounding_box(&self) -> Rect
pub fn abs_stroke_bounding_box(&self) -> Rect
Element’s bounding box including stroke in canvas coordinates.
Will have the same value as abs_bounding_box when path has no stroke.