Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions egui_plot/src/plot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,6 @@ impl<'a> Plot<'a> {
mem.auto_bounds = true.into();
}

let any_dynamic_modifications = !plot_ui.bounds_modifications.is_empty();
// Apply bounds modifications.
for modification in &plot_ui.bounds_modifications {
match modification {
Expand Down Expand Up @@ -1006,11 +1005,11 @@ impl<'a> Plot<'a> {
}
}

// Reset bounds to initial bounds if they haven't been modified.
if (!self.default_auto_bounds.x && !any_dynamic_modifications) || mem.auto_bounds.x {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope my understanding of the full intention here is correct. I thought long and hard about it, and played around with a number of different configurations, and this works well.
But I'm suspicious that I'm missing something important

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could not find any problems here either

// Reset bounds to initial bounds if current auto_bounds are active.
if mem.auto_bounds.x {
bounds.set_x(&self.min_auto_bounds);
}
if (!self.default_auto_bounds.y && !any_dynamic_modifications) || mem.auto_bounds.y {
if mem.auto_bounds.y {
bounds.set_y(&self.min_auto_bounds);
}

Expand Down
Loading