commit 7819b8686147ed8e274ddcce52624b63afc6d554
parent 37f8da235362b99e0444b2e7a7bebf9dd0e7c0e7
Author: Anselm R. Garbe <garbeam@wmii.de>
Date: Fri, 14 Apr 2006 11:50:20 +0200
fixed negative (x,y) issue in place_client
Diffstat:
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/cmd/wm/area.c b/cmd/wm/area.c
@@ -165,10 +165,16 @@ place_client(Area *a, Client *c)
cy = f->rect.height / dy;
continue;
}
- x = fr->rect.x / dx;
- y = fr->rect.y / dy;
- maxx = x + fr->rect.width / dx;
- maxy = y + fr->rect.height / dy;
+ if(fr->rect.x < 0)
+ x = 0;
+ else
+ x = fr->rect.x / dx;
+ if(fr->rect.y < 0)
+ y = 0;
+ else
+ y = fr->rect.y / dy;
+ maxx = (fr->rect.x + fr->rect.width) / dx;
+ maxy = (fr->rect.y + fr->rect.height) / dy;
for(j = y; j < my && j < maxy; j++)
for(i = x; i < mx && i < maxx; i++)
field[j*mx + i] = False;
@@ -187,8 +193,6 @@ place_client(Area *a, Client *c)
p1.y = y;
p2.x = i;
p2.y = j;
- fprintf(stderr, "place_client fit %d %d %d %d, (%d > %d) && (%d > %d)\n",
- x, y, i, j, i-x, cx, j - y, cy);
}
}
}