fix horizontal bsp

This commit is contained in:
🪞👃🪞 2025-01-01 19:48:26 +01:00
parent b2d8d25366
commit 9125e04e07

View file

@ -75,13 +75,13 @@ impl<E: Engine, A: Content<E>, B: Content<E>> Bsp<E, A, B> {
[a.into(), b.into(), [x, y, w, h].into()] [a.into(), b.into(), [x, y, w, h].into()]
}, },
East => { East => {
let [x, y, w, h] = outer.center_xy([aw.max(bw), ah + bh]); let [x, y, w, h] = outer.center_xy([aw + bw, ah.max(bh)]);
let a = [x, y, aw, ah]; let a = [x, y, aw, ah];
let b = [x + aw, y, bw, bh]; let b = [x + aw, y, bw, bh];
[a.into(), b.into(), [x, y, w, h].into()] [a.into(), b.into(), [x, y, w, h].into()]
}, },
West => { West => {
let [x, y, w, h] = outer.center_xy([aw.max(bw), ah + bh]); let [x, y, w, h] = outer.center_xy([aw + bw, ah.max(bh)]);
let a = [x + bw, y, aw, ah]; let a = [x + bw, y, aw, ah];
let b = [x, y, bw, bh]; let b = [x, y, bw, bh];
[a.into(), b.into(), [x, y, w, h].into()] [a.into(), b.into(), [x, y, w, h].into()]