Skip to content

Commit

Permalink
setting deviceOrientation prior to setup based on window size closes p…
Browse files Browse the repository at this point in the history
  • Loading branch information
lmccart committed Dec 15, 2019
1 parent 3463d77 commit 6b9b726
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/events/acceleration.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import p5 from '../core/main';
* @property {Constant} deviceOrientation
* @readOnly
*/
p5.prototype.deviceOrientation = undefined;
p5.prototype.deviceOrientation =
window.innerWidth / window.innerHeight > 1.0 ? 'landscape' : 'portrait';

/**
* The system variable accelerationX always contains the acceleration of the
Expand Down

0 comments on commit 6b9b726

Please sign in to comment.