Skip to content

Commit

Permalink
widget: slider: Remove check_step()
Browse files Browse the repository at this point in the history
We now handle that case and allow for self.max to be reached.

Signed-off-by: Christopher N. Hesse <[email protected]>
  • Loading branch information
raymanfx committed Jul 25, 2021
1 parent 55c0521 commit 5ddbd6c
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions druid/src/widget/slider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,6 @@ impl Slider {
};
self
}

fn check_step(&self) {
if let Some(step) = self.step {
let max_step_value = (100.0 / step).round() * step;
if max_step_value < self.max {
warn!(
"max ({}) - min ({}) should be a multiple of step ({})",
self.max, self.min, step
);
}
}
}
}

impl Slider {
Expand Down Expand Up @@ -178,9 +166,6 @@ impl Widget<f64> for Slider {
#[instrument(name = "Slider", level = "trace", skip(self, ctx, event, _data, _env))]
fn lifecycle(&mut self, ctx: &mut LifeCycleCtx, event: &LifeCycle, _data: &f64, _env: &Env) {
match event {
LifeCycle::WidgetAdded => {
self.check_step();
}
LifeCycle::DisabledChanged(_) => {
ctx.request_paint();
}
Expand Down

0 comments on commit 5ddbd6c

Please sign in to comment.