Fix bird not flying to right location when iOS address bar is minimized

This commit is contained in:
Idrees Hassan
2025-10-28 23:11:46 -04:00
parent 2c0438cc0a
commit 66284b0af8
6 changed files with 106 additions and 87 deletions

View File

@@ -1,4 +1,4 @@
import { Directions, getLayer } from './shared.js';
import { Directions, getLayer, getWindowHeight, getFixedWindowHeight } from './shared.js';
import Layer from './layer.js';
import Frame from './frame.js';
import Anim from './anim.js';
@@ -201,7 +201,8 @@ export class Birb {
let bottom;
if (this.isAbsolutePositioned) {
// Position is absolute, convert from fixed
bottom = y - window.scrollY;
// Account for address bar shrinkage on iOS
bottom = y - window.scrollY - (getWindowHeight() - getFixedWindowHeight());
} else {
// Position is fixed
bottom = y;