magnifier: simplify formula
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
fdddc839e8
commit
e753be131d
|
@ -48,8 +48,8 @@ layout_magnifier(int screen)
|
||||||
if(!focus)
|
if(!focus)
|
||||||
goto bailout;
|
goto bailout;
|
||||||
|
|
||||||
geometry.width = sqrt(area.width * area.width * curtags[0]->mwfact);
|
geometry.width = area.width * sqrt(curtags[0]->mwfact);
|
||||||
geometry.height = sqrt(area.height * area.height * curtags[0]->mwfact);
|
geometry.height = area.height * sqrt(curtags[0]->mwfact);
|
||||||
geometry.x = area.x + (area.width - geometry.width) / 2;
|
geometry.x = area.x + (area.width - geometry.width) / 2;
|
||||||
geometry.y = area.y + (area.height - geometry.height) / 2;
|
geometry.y = area.y + (area.height - geometry.height) / 2;
|
||||||
client_resize(focus, geometry, focus->honorsizehints);
|
client_resize(focus, geometry, focus->honorsizehints);
|
||||||
|
|
2
mouse.c
2
mouse.c
|
@ -910,7 +910,7 @@ mouse_client_resize_magnified(client_t *c, bool infobox)
|
||||||
/* calc distance from the center */
|
/* calc distance from the center */
|
||||||
dx = center_x - mouse_x;
|
dx = center_x - mouse_x;
|
||||||
dy = center_y - mouse_y;
|
dy = center_y - mouse_y;
|
||||||
dist = sqrt((dx*dx) + (dy*dy));
|
dist = sqrt((dx * dx) + (dy * dy));
|
||||||
|
|
||||||
/* new master/rest ratio */
|
/* new master/rest ratio */
|
||||||
mwfact = (dist * dist) / (maxdist * maxdist);
|
mwfact = (dist * dist) / (maxdist * maxdist);
|
||||||
|
|
Loading…
Reference in New Issue