Module svg_definitions::path
source · Expand description
This module provides an nicer and easier way to interact with SVG Path Definition Strings.
Note
In the crate::prelude the name for PathDefinitionString is PathData
Examples
1) Triangle
use svg_definitions::prelude::*;
let path_definition_string = PathData::new()
.move_to((0.0, 0.0))
.line_to((10.0, 0.0))
.line_to((0.0, 10.0))
.line_to((0.0, 0.0))
.close_path();
2) Relative Triangle
use svg_definitions::prelude::*;
let path_definition_string = PathData::new()
.move_to((0.0, 0.0))
.r_line_to((10.0, 0.0))
.r_line_to((-10.0, 10.0))
.r_line_to((0.0, -10.0))
.close_path();