dwm-meillo

changeset 732:a642068c4834

simplification
author Anselm R. Garbe <arg@suckless.org>
date Tue, 06 Feb 2007 15:28:25 +0100
parents 29c9b557ed95
children 1950833a5614
files client.c
diffstat 1 files changed, 5 insertions(+), 10 deletions(-) [+]
line diff
     1.1 --- a/client.c	Tue Feb 06 15:22:13 2007 +0100
     1.2 +++ b/client.c	Tue Feb 06 15:28:25 2007 +0100
     1.3 @@ -10,13 +10,6 @@
     1.4  /* static */
     1.5  
     1.6  static void
     1.7 -closestpt(float *rx, float *ry, float x, float y, float grad) {
     1.8 -	float u = (x * grad + y) / (grad * grad + 1);
     1.9 -	*rx = u * grad;
    1.10 -	*ry = u;
    1.11 -}
    1.12 -
    1.13 -static void
    1.14  detachstack(Client *c) {
    1.15  	Client **tc;
    1.16  	for(tc=&stack; *tc && *tc != c; tc=&(*tc)->snext);
    1.17 @@ -191,7 +184,7 @@
    1.18  
    1.19  void
    1.20  resize(Client *c, Bool sizehints) {
    1.21 -	float dx, dy, min, max, actual;
    1.22 +	float actual, dx, dy, max, min, u;
    1.23  	XWindowChanges wc;
    1.24  
    1.25  	if(c->w <= 0 || c->h <= 0)
    1.26 @@ -214,12 +207,14 @@
    1.27  			actual = dx / dy;
    1.28  			if(max > 0 && min > 0 && actual > 0) {
    1.29  				if(actual < min) {
    1.30 -					closestpt(&dx, &dy, dx, dy, min);
    1.31 +					dy = (dx * min + dy) / (min * min + 1);
    1.32 +					dx = dy * min;
    1.33  					c->w = (int)dx + c->basew;
    1.34  					c->h = (int)dy + c->baseh;
    1.35  				}
    1.36  				else if(actual > max) {
    1.37 -					closestpt(&dx, &dy, dx, dy, max);
    1.38 +					dy = (dx * min + dy) / (max * max + 1);
    1.39 +					dx = dy * min;
    1.40  					c->w = (int)dx + c->basew;
    1.41  					c->h = (int)dy + c->baseh;
    1.42  				}