Mercurial > aewl
changeset 554:1734939bceba
fixed stupid bug of snap-to-screen
author | arg@mig29 |
---|---|
date | Mon, 30 Oct 2006 12:26:55 +0100 |
parents | 5094facab5c7 |
children | c0a0245b9815 |
files | event.c |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/event.c Mon Oct 30 12:07:00 2006 +0100 +++ b/event.c Mon Oct 30 12:26:55 2006 +0100 @@ -48,13 +48,13 @@ XSync(dpy, False); c->x = ocx + (ev.xmotion.x - x1); c->y = ocy + (ev.xmotion.y - y1); - if(abs(c->x) < sx + SNAP) + if(abs(c->x) < SNAP) c->x = sx; - else if(c->x + c->w > sx + sw - SNAP) + else if(abs((sx + sw) - (c->x + c->w)) < SNAP) c->x = sw - c->w - 2 * BORDERPX; - if(abs(c->y) < sy + bh + SNAP) + if(abs((sy + bh) - c->y) < SNAP) c->y = sy + bh; - else if(c->y + c->h > sy + sh - SNAP) + else if(abs((sy + sh) - (c->y + c->h)) < SNAP) c->y = sh - c->h - 2 * BORDERPX; resize(c, False, TopLeft); break;