diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-05-29 13:47:08 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-05-31 15:30:45 -0400 |
commit | 8c74a1b99c6d60e0bd884efd946169559348756e (patch) | |
tree | 543f3736d1f10587b7ca8603c6adc92778f947bc | |
parent | 2562b4a2f0756350dd62f32673d6b99609262f86 (diff) |
make pane divider placement a little safer
-rw-r--r-- | libs/gtkmm2ext/pane.cc | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/libs/gtkmm2ext/pane.cc b/libs/gtkmm2ext/pane.cc index a9920f877e..31408eb777 100644 --- a/libs/gtkmm2ext/pane.cc +++ b/libs/gtkmm2ext/pane.cc @@ -393,8 +393,6 @@ Pane::handle_motion_event (GdkEventMotion* ev, Divider* d) void Pane::set_divider (Dividers::size_type div, float fract) { - bool redraw = false; - Dividers::iterator d = dividers.begin(); while (div--) { @@ -407,12 +405,10 @@ Pane::set_divider (Dividers::size_type div, float fract) } } + fract = max (0.0f, min (1.0f, fract)); + if (fract != (*d)->fract) { (*d)->fract = fract; - redraw = true; - } - - if (redraw) { /* our size hasn't changed, but our internal allocations have */ reallocate (get_allocation()); queue_draw (); |