Skip to content

Commit

Permalink
Merge pull request #1 from vizorvr/fix-device-orientation-bug
Browse files Browse the repository at this point in the history
Fix a device orientation bug on iPhone
  • Loading branch information
l-brett authored Sep 6, 2018
2 parents c33c805 + 05133bb commit 7b6ca65
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/TouchHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ export default class TouchHandler {
el.addEventListener('touchstart', this.startFn, {passive: false});
el.addEventListener('touchmove', this.moveFn, {passive: false});
el.addEventListener('touchend', this.endFn, {passive: false});
el.addEventListener('touchcancel', this.endFn, {passive: false});
}

unbindEvents() {
let el = this.options['element'];
el.removeEventListener('touchstart', this.startFn);
el.removeEventListener('touchmove', this.moveFn);
el.removeEventListener('touchend', this.endFn);
el.removeEventListener('touchcancel', this.endFn);
}

inRange(x, y, stick) {
Expand Down
2 changes: 0 additions & 2 deletions src/VirtualStick.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ export class VirtualStick {
'track-stroke-size': this.options['track-stroke-size']
});

window.addEventListener("resize", () => this.stick.createCanvas(), false);

this.options['touch-handler'].addStick(this);
}

Expand Down

0 comments on commit 7b6ca65

Please sign in to comment.