New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make sure plot size is positive #4429
Conversation
@@ -105,7 +105,10 @@ impl super::View for ContextMenus { | |||
.speed(1.0) | |||
.prefix("Height: "), | |||
); | |||
self.width = self.width.at_least(1.0); | |||
self.height = self.height.at_least(1.0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use DragValue::clamp_range
instead
crates/egui_plot/src/lib.rs
Outdated
// Minimum values for screen protection | ||
min_size.x = min_size.x.at_least(64.0); | ||
min_size.y = min_size.y.at_least(15.0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should do this. If the user wants a plot that is 16x32
pixels big, let them have it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should do this. If the user wants a plot that is
16x32
pixels big, let them have it
If it is greater than 1.0
, panic does not occur, so it was set to 1.0
.
If you want to edit it to a different size, please do so.
Fix: in Plot, Minimum values for screen protection.