From e753be131d8d3af755e8c80566e7918c6e8253ef Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sat, 23 Aug 2008 08:40:07 +0200 Subject: [PATCH] magnifier: simplify formula Signed-off-by: Julien Danjou --- layouts/magnifier.c | 4 ++-- mouse.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/layouts/magnifier.c b/layouts/magnifier.c index 6485ef6e..ae0b6eff 100644 --- a/layouts/magnifier.c +++ b/layouts/magnifier.c @@ -48,8 +48,8 @@ layout_magnifier(int screen) if(!focus) goto bailout; - geometry.width = sqrt(area.width * area.width * curtags[0]->mwfact); - geometry.height = sqrt(area.height * area.height * curtags[0]->mwfact); + geometry.width = area.width * sqrt(curtags[0]->mwfact); + geometry.height = area.height * sqrt(curtags[0]->mwfact); geometry.x = area.x + (area.width - geometry.width) / 2; geometry.y = area.y + (area.height - geometry.height) / 2; client_resize(focus, geometry, focus->honorsizehints); diff --git a/mouse.c b/mouse.c index 1f6ab69e..e43702ae 100644 --- a/mouse.c +++ b/mouse.c @@ -910,7 +910,7 @@ mouse_client_resize_magnified(client_t *c, bool infobox) /* calc distance from the center */ dx = center_x - mouse_x; dy = center_y - mouse_y; - dist = sqrt((dx*dx) + (dy*dy)); + dist = sqrt((dx * dx) + (dy * dy)); /* new master/rest ratio */ mwfact = (dist * dist) / (maxdist * maxdist);