Skip to content
This repository has been archived by the owner on Apr 29, 2018. It is now read-only.

Commit

Permalink
Fix cross-browser fullscreen bugs
Browse files Browse the repository at this point in the history
Closes #34.
  • Loading branch information
Leon Byford committed Mar 30, 2015
1 parent 4572424 commit 14038f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion game-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ canvas {
image-rendering: -moz-crisp-edges;
image-rendering: -o-crisp-edges;
image-rendering: -webkit-optimize-contrast;
image-rendering: crisp-edges;
-ms-interpolation-mode: nearest-neighbor;
image-rendering: crisp-edges;
image-rendering: pixelated;
cursor: pointer;
}
6 changes: 3 additions & 3 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,12 @@ $("body").on("keypress", function(e) {
$(document).on("webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange", function() {
var fullscreenElement = document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement;
if (fullscreenElement) {
if ($("body").width() < $("body").height()) {
$("#p").width($("body").width());
if ($(window).width() < $(window).height()) {
$("#p").width($(window).width());
$("#p").height($("#p").width()/4*3);
}
else {
$("#p").height($("body").height());
$("#p").height($(window).height());
$("#p").width($("#p").height()/3*4);
}
}
Expand Down

0 comments on commit 14038f8

Please # to comment.