Skip to content

Commit

Permalink
Merge pull request #11 from gl-vis/tablets
Browse files Browse the repository at this point in the history
Enable tablet
  • Loading branch information
etpinard authored Oct 10, 2018
2 parents af2e4f5 + 6c1e17e commit 026b6c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"gl-shader": "^4.2.1",
"gl-spikes3d": "^1.0.3",
"glslify": "^6.1.0",
"is-mobile": "^0.2.2",
"is-mobile": "^2.0.0",
"mouse-change": "^1.1.1",
"ndarray": "^1.0.16"
},
Expand Down
8 changes: 5 additions & 3 deletions scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var drawTriangle = require('a-big-triangle')
var mouseChange = require('mouse-change')
var perspective = require('gl-mat4/perspective')
var createShader = require('./lib/shader')
var isMobile = require('is-mobile')()
var isMobile = require('is-mobile')({ tablet: true })

function MouseSelect() {
this.mouse = [-1,-1]
Expand Down Expand Up @@ -80,7 +80,8 @@ function createScene(options) {
gl = getContext(canvas,
options.glOptions || {
premultipliedAlpha: true,
antialias: true
antialias: true,
preserveDrawingBuffer: isMobile
})
}
if(!gl) {
Expand Down Expand Up @@ -745,8 +746,9 @@ function createScene(options) {
if(stopped || scene.contextLost) {
return
}
requestAnimationFrame(render)
// this order is important: ios safari sometimes has sync raf
redraw()
requestAnimationFrame(render)
}
render()

Expand Down

0 comments on commit 026b6c1

Please sign in to comment.