From 8c74a1b99c6d60e0bd884efd946169559348756e Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 29 May 2016 13:47:08 -0400 Subject: make pane divider placement a little safer --- libs/gtkmm2ext/pane.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'libs') 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 (); -- cgit v1.2.3