13
0

make pane divider placement a little safer

This commit is contained in:
Paul Davis 2016-05-29 13:47:08 -04:00
parent 2562b4a2f0
commit 8c74a1b99c

View File

@ -393,8 +393,6 @@ Pane::handle_motion_event (GdkEventMotion* ev, Divider* d)
void void
Pane::set_divider (Dividers::size_type div, float fract) Pane::set_divider (Dividers::size_type div, float fract)
{ {
bool redraw = false;
Dividers::iterator d = dividers.begin(); Dividers::iterator d = dividers.begin();
while (div--) { 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) { if (fract != (*d)->fract) {
(*d)->fract = fract; (*d)->fract = fract;
redraw = true;
}
if (redraw) {
/* our size hasn't changed, but our internal allocations have */ /* our size hasn't changed, but our internal allocations have */
reallocate (get_allocation()); reallocate (get_allocation());
queue_draw (); queue_draw ();