Skip to content

Commit

Permalink
Prevent plot from resetting one axis while zooming/dragging the other
Browse files Browse the repository at this point in the history
Closes emilk#4251
  • Loading branch information
YgorSouza committed Mar 27, 2024
1 parent 58a2788 commit d737f4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/egui_plot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ impl Plot {
delta.y = 0.0;
}
mem.transform.translate_bounds(delta);
mem.auto_bounds = !allow_drag;
mem.auto_bounds = false.into();
}

// Zooming
Expand Down Expand Up @@ -1092,7 +1092,7 @@ impl Plot {
}
if zoom_factor != Vec2::splat(1.0) {
mem.transform.zoom(zoom_factor, hover_pos);
mem.auto_bounds = !allow_zoom;
mem.auto_bounds = false.into();
}
}
if allow_scroll.any() {
Expand Down

0 comments on commit d737f4e

Please sign in to comment.