dwm-meillo
diff event.c @ 554:1734939bceba
fixed stupid bug of snap-to-screen
author | arg@mig29 |
---|---|
date | Mon, 30 Oct 2006 12:26:55 +0100 |
parents | 5094facab5c7 |
children | 12deea36603d |
line diff
1.1 --- a/event.c Mon Oct 30 12:07:00 2006 +0100 1.2 +++ b/event.c Mon Oct 30 12:26:55 2006 +0100 1.3 @@ -48,13 +48,13 @@ 1.4 XSync(dpy, False); 1.5 c->x = ocx + (ev.xmotion.x - x1); 1.6 c->y = ocy + (ev.xmotion.y - y1); 1.7 - if(abs(c->x) < sx + SNAP) 1.8 + if(abs(c->x) < SNAP) 1.9 c->x = sx; 1.10 - else if(c->x + c->w > sx + sw - SNAP) 1.11 + else if(abs((sx + sw) - (c->x + c->w)) < SNAP) 1.12 c->x = sw - c->w - 2 * BORDERPX; 1.13 - if(abs(c->y) < sy + bh + SNAP) 1.14 + if(abs((sy + bh) - c->y) < SNAP) 1.15 c->y = sy + bh; 1.16 - else if(c->y + c->h > sy + sh - SNAP) 1.17 + else if(abs((sy + sh) - (c->y + c->h)) < SNAP) 1.18 c->y = sh - c->h - 2 * BORDERPX; 1.19 resize(c, False, TopLeft); 1.20 break;