Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect fullscreen check #80

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cdrch
Copy link

@cdrch cdrch commented Jul 31, 2021

Fixes a problem introduced with the addition of fullscreen. Previously, the pointer placement had been incorrectly scaled due to the scale constantly resetting, which was caused by an incorrect call to fullscreenEnabled, which checks whether or not a browser can support fullscreen, rather than if it is currently. It has been replaced in this PR with checking if there are any current elements of the page in fullscreen; if none (document.fullscreenElement != null), then it is considered not fullscreen. Otherwise, it is.

This should fix #65 and potentially help with solving #33.

Update: found other areas of code with the same issue. Flappy Fairy now goes properly fullscreen. Fixes #45 and #78.

Fullscreen games now work properly with modern browsers.
@cdrch cdrch mentioned this pull request Jul 31, 2021
bsorrentino added a commit to bsorrentino/ga that referenced this pull request Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Button click area problems The Fullscreen feature...
1 participant