mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 09:42:21 +00:00
fix(ui): any positive room counts when a midpoint band asks for no minimum
Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
1 parent
fd64a78aca
commit
c1e58b72b9
1 file changed
+3
-3
@@ -139,9 +139,9 @@ export function bandBesideMidpointObstacles({
|
||||
};
|
||||
const roomAbove = above.bottom - above.top;
|
||||
const roomBelow = below.bottom - below.top;
|
||||
const least = Math.max(minimum, Number.EPSILON);
|
||||
if (roomBelow > roomAbove && roomBelow >= least) return below;
|
||||
return roomAbove >= least ? above : null;
|
||||
const fits = (room) => room > 0 && room >= minimum;
|
||||
if (roomBelow > roomAbove && fits(roomBelow)) return below;
|
||||
return fits(roomAbove) ? above : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user