pub struct EdgeInProgress {
pub start: PositionedSocket,
pub end_pos: Pos2,
pub end_socket: Option<(SocketKind, Vec2)>,
}Fields§
§start: PositionedSocketThe socket at the start end of the edge.
end_pos: Pos2The end position of the edge in progress.
If there is no socket within the interaction radius, this will be the pointer position.
Otherwise, this will be the position of the closest socket who’s SocketKind is opposite
to start.kind.
end_socket: Option<(SocketKind, Vec2)>The closest socket who’s SocketKind is opposite to start.kind.
This is None in the case that there are no sockets within the interaction radius.
Implementations§
Source§impl EdgeInProgress
impl EdgeInProgress
Sourcepub fn bezier_cubic(&self, curvature: f32) -> Cubic
pub fn bezier_cubic(&self, curvature: f32) -> Cubic
Construct the bezier curve for this in-progress edge.
curvature is a normalized 0.0..=1.0 value controlling how
pronounced the curve is. See bezier::Cubic::DEFAULT_CURVATURE.
Sourcepub fn show(&self, ui: &Ui, curvature: f32)
pub fn show(&self, ui: &Ui, curvature: f32)
Short-hand for painting the in-progress edge with some reasonable defaults.
If you require custom styling of the in-progress edge, use
EdgeInProgress::bezier_cubic or the individual fields to paint it
however you wish.