Skip to main content

RouteEdgeExt

Trait RouteEdgeExt 

Source
pub trait RouteEdgeExt {
    // Required methods
    fn distance(&self, pos: Pos2) -> (f32, f32);
    fn length(&self) -> f32;
}
Expand description

Pixel-space helpers for RouteEdge. Kept out of the data model because they work in world (egui) coordinates.

Required Methods§

Source

fn distance(&self, pos: Pos2) -> (f32, f32)

The distance of pos projected onto the segment, paired with the perpendicular distance from pos to the segment. Both in world pixels: this pair never leaves widget-layer geometry math, so neither side is worth a named unit.

Source

fn length(&self) -> f32

The segment’s world-space length.

Implementors§