mod arc;
mod builder;
#[doc(no_inline)]
pub use arc::{ArcPath, EllipticalArcPath};
pub use builder::PathBuilder;
use rootvg_core::math::{Point, Size};
#[derive(Debug, Clone)]
pub struct Path {
pub raw: lyon::path::Path,
}
impl Path {
pub fn builder() -> PathBuilder {
PathBuilder::new()
}
pub fn line(from: Point, to: Point) -> Self {
PathBuilder::new().move_to(from).line_to(to).build()
}
pub fn rectangle(top_left: Point, size: Size) -> Self {
PathBuilder::new().rectangle(top_left, size).build()
}
pub fn circle(center: Point, radius: f32) -> Self {
PathBuilder::new().circle(center, radius).build()
}
pub fn transform(&self, transform: &lyon::path::math::Transform) -> Path {
Path {
raw: self.raw.clone().transformed(transform),
}
}
}