zakarumych / egui-snarl

Customizable egui node-graph library
https://crates.io/crates/egui-snarl
MIT License
287 stars 28 forks source link

Little bug when using AxisAlignedWire #30

Closed crane-may closed 2 months ago

crane-may commented 2 months ago

I've found that with AxisAlignedWire if to appears to the left of from, the line may disappear when the screen moves.

Then I found a change in one line of code that solved the problem.

src/ui/wire.rs line 696:

fn draw_axis_aligned(
    ui: &Ui,
    shapes: &mut Vec<Shape>,
    corner_radius: f32,
    frame_size: f32,
    from: Pos2,
    to: Pos2,
    stroke: Stroke,
) {
    let aabb = Rect::from_two_pos(from, to);  // original code:  let aabb = Rect::from_min_max(from, to);

    if !ui.is_rect_visible(aabb) {
        return;
    }

...

Btw, I love this toolkit.

zakarumych commented 2 months ago

Thanks for the report. And for kind feedback :) Fixed in 983b9cc7cc7bd34e319d3091e95d98c5c65ec39a

zakarumych commented 2 months ago

Released in 0.4.4