mouse: keep mwfact within sensible bounds

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Michael Gehring 2008-06-14 23:37:48 +02:00 committed by Julien Danjou
parent 7690dba009
commit aa33631263
1 changed files with 3 additions and 0 deletions

View File

@ -661,6 +661,9 @@ mouse_client_resize_tiled(client_t *c)
else if(layout == layout_tiletop)
mwfact = 1. - fact_y;
/* keep mwfact within sensible bounds */
mwfact = MIN( MAX( 0.01, mwfact), 0.99 );
/* refresh layout */
if(fabs(tag->mwfact - mwfact) >= 0.01)
{