mirror of
https://github.com/NohamR/Pocket-Bird.git
synced 2026-05-25 04:07:23 +00:00
Fix bird not flying to right location when iOS address bar is minimized
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user