From 83a2fb66cf4579c761521a3b4f3fba321d109378 Mon Sep 17 00:00:00 2001 From: Michael Gehring Date: Sun, 15 Jun 2008 21:20:36 +0200 Subject: [PATCH] mouse: keep mwfact withing reasonable bounds again Signed-off-by: Julien Danjou --- mouse.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mouse.c b/mouse.c index 300f077ea..546d64ff1 100644 --- a/mouse.c +++ b/mouse.c @@ -823,6 +823,9 @@ mouse_client_resize_magnified(client_t *c, bool infobox) /* new master/rest ratio */ mwfact = dist / maxdist; + /* keep mwfact within reasonable bounds */ + mwfact = MIN(MAX( 0.01, mwfact), 0.99); + /* refresh the layout */ if(fabs(tag->mwfact - mwfact) >= 0.01) {