fix layering misalignment

This commit is contained in:
🪞👃🪞 2025-01-10 19:28:58 +01:00
parent 7db3d2aa4c
commit ccd905d573

View file

@ -61,11 +61,10 @@ pub trait BspAreas<E: Output, A: Content<E>, B: Content<E>> {
}).xywh();
match direction {
Above | Below => {
let x = ax.min(bx);
let w = (ax+aw).max(bx+bw).minus(x);
let y = ay.min(by);
let h = (ay+ah).max(by+bh).minus(y);
[[ax, ay, aw, ah].into(), [bx, by, bw, bh].into(), [x, y, w, h].into()]
let [x, y, w, h] = outer.center_xy([aw.max(bw), ah.max(bh)]);
let a = [(x + w/2.into()).minus(aw/2.into()), (y + h/2.into()).minus(ah/2.into()), aw, ah];
let b = [(x + w/2.into()).minus(bw/2.into()), (y + h/2.into()).minus(bh/2.into()), bw, bh];
[a.into(), b.into(), [x, y, w, h].into()]
},
South => {
let [x, y, w, h] = outer.center_xy([aw.max(bw), ah + bh]);