use bevy_prototype_lyon::prelude::Geometry;
use flowkit::extend_from::ExtendFrom;
use lyon_path::{BuilderImpl, builder::WithSvg};
pub use flowkit::{
corner::{Corner, CornerPathParams},
edge::{EdgeAnchor, EdgePath, EdgePoint, EdgeType},
path::PathBuilder,
};
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Connection(EdgePath);
impl Default for Connection {
fn default() -> Self {
Self(EdgePath::DEFAULT)
}
}
impl From<EdgePath> for Connection {
fn from(path: EdgePath) -> Self {
Self(path)
}
}
impl Geometry<WithSvg<BuilderImpl>> for Connection {
fn add_geometry(&self, builder: &mut WithSvg<BuilderImpl>) {
builder.extend_from(PathBuilder::from((self.0, false)));
}
}