1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

Prevent plot from resetting one axis while zooming/dragging the other (#4252)

* Closes <https://github.com/emilk/egui/issues/4251>
This commit is contained in:
YgorSouza
2024-03-28 10:43:28 +01:00
committed by GitHub
parent 3dba73e63e
commit c4f16af721

View File

@@ -1021,7 +1021,7 @@ impl Plot {
delta.y = 0.0;
}
mem.transform.translate_bounds(delta);
mem.auto_bounds = !allow_drag;
mem.auto_bounds = mem.auto_bounds.and(!allow_drag);
}
// Zooming
@@ -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 = mem.auto_bounds.and(!allow_zoom);
}
}
if allow_scroll.any() {