This commit is contained in:
parent
81b154982b
commit
183e2b0e04
1 changed files with 14 additions and 2 deletions
|
|
@ -1735,6 +1735,7 @@ static void clip(MwLL handle) {
|
||||||
if(toplevel) {
|
if(toplevel) {
|
||||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||||
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
||||||
|
/* i seriously have no fucking idea how this works, do not ask me how this really works (nishi) */
|
||||||
x = 0;
|
x = 0;
|
||||||
y = 0;
|
y = 0;
|
||||||
cx = 0;
|
cx = 0;
|
||||||
|
|
@ -1744,11 +1745,22 @@ static void clip(MwLL handle) {
|
||||||
// ws is traversed result
|
// ws is traversed result
|
||||||
// ws[ws.length - 1] is ignored bc it's toplevel
|
// ws[ws.length - 1] is ignored bc it's toplevel
|
||||||
for(i = arrlen(ws) - 2; i >= 0; i--) {
|
for(i = arrlen(ws) - 2; i >= 0; i--) {
|
||||||
|
int j;
|
||||||
|
int l = 0;
|
||||||
|
|
||||||
x += ws[i]->wayland.x;
|
x += ws[i]->wayland.x;
|
||||||
y += ws[i]->wayland.y;
|
y += ws[i]->wayland.y;
|
||||||
|
|
||||||
cx = MAX(cx, ws[i]->wayland.x);
|
for(j = i - 1; j >= 0; j--){
|
||||||
cy = MAX(cy, ws[i]->wayland.y);
|
if(ws[j]->wayland.x > cx) l = 1;
|
||||||
|
if(ws[j]->wayland.y > cy) l = 1;
|
||||||
|
if(l) break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!l){
|
||||||
|
cx = MAX(cx, ws[i]->wayland.x);
|
||||||
|
cy = MAX(cy, ws[i]->wayland.y);
|
||||||
|
}
|
||||||
|
|
||||||
mx = MIN(mx, x + ws[i]->wayland.ww);
|
mx = MIN(mx, x + ws[i]->wayland.ww);
|
||||||
my = MIN(my, y + ws[i]->wayland.wh);
|
my = MIN(my, y + ws[i]->wayland.wh);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue