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(); }).xywh();
match direction { match direction {
Above | Below => { Above | Below => {
let x = ax.min(bx); let [x, y, w, h] = outer.center_xy([aw.max(bw), ah.max(bh)]);
let w = (ax+aw).max(bx+bw).minus(x); let a = [(x + w/2.into()).minus(aw/2.into()), (y + h/2.into()).minus(ah/2.into()), aw, ah];
let y = ay.min(by); let b = [(x + w/2.into()).minus(bw/2.into()), (y + h/2.into()).minus(bh/2.into()), bw, bh];
let h = (ay+ah).max(by+bh).minus(y); [a.into(), b.into(), [x, y, w, h].into()]
[[ax, ay, aw, ah].into(), [bx, by, bw, bh].into(), [x, y, w, h].into()]
}, },
South => { South => {
let [x, y, w, h] = outer.center_xy([aw.max(bw), ah + bh]); let [x, y, w, h] = outer.center_xy([aw.max(bw), ah + bh]);