mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
fix layering misalignment
This commit is contained in:
parent
7db3d2aa4c
commit
ccd905d573
1 changed files with 4 additions and 5 deletions
|
|
@ -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]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue