@@ -248,10 +248,10 @@ function tryCreatePlot(scene, cameraObject, pixelRatio, canvas, gl) {
248
248
return failed < 2 ;
249
249
}
250
250
251
- function initializeGLPlot ( scene , pixelRatio , canvas , gl ) {
251
+ function initializeGLPlot ( scene , canvas , gl ) {
252
252
scene . initializeGLCamera ( ) ;
253
253
254
- var success = tryCreatePlot ( scene , scene . camera , pixelRatio , canvas , gl ) ;
254
+ var success = tryCreatePlot ( scene , scene . camera , scene . pixelRatio , canvas , gl ) ;
255
255
/*
256
256
* createPlot will throw when webgl is not enabled in the client.
257
257
* Lets return an instance of the module with all functions noop'd.
@@ -393,7 +393,7 @@ function Scene(options, fullLayout) {
393
393
this . convertAnnotations = Registry . getComponentMethod ( 'annotations3d' , 'convert' ) ;
394
394
this . drawAnnotations = Registry . getComponentMethod ( 'annotations3d' , 'draw' ) ;
395
395
396
- initializeGLPlot ( this , this . pixelRatio ) ;
396
+ initializeGLPlot ( this ) ;
397
397
}
398
398
399
399
var proto = Scene . prototype ;
@@ -417,15 +417,15 @@ proto.recoverContext = function() {
417
417
var scene = this ;
418
418
var gl = this . glplot . gl ;
419
419
var canvas = this . glplot . canvas ;
420
- var pixelRatio = this . glplot . pixelRatio ;
420
+
421
421
this . glplot . dispose ( ) ;
422
422
423
423
function tryRecover ( ) {
424
424
if ( gl . isContextLost ( ) ) {
425
425
requestAnimationFrame ( tryRecover ) ;
426
426
return ;
427
427
}
428
- if ( ! initializeGLPlot ( scene , pixelRatio , canvas , gl ) ) {
428
+ if ( ! initializeGLPlot ( scene , canvas , gl ) ) {
429
429
Lib . error ( 'Catastrophic and unrecoverable WebGL error. Context lost.' ) ;
430
430
return ;
431
431
}
@@ -825,8 +825,6 @@ proto.setViewport = function(sceneLayout) {
825
825
if ( newOrtho !== oldOrtho ) {
826
826
this . glplot . redraw ( ) ;
827
827
828
- var pixelRatio = this . glplot . pixelRatio ;
829
-
830
828
var RGBA = this . glplot . clearColor ;
831
829
this . glplot . gl . clearColor (
832
830
RGBA [ 0 ] , RGBA [ 1 ] , RGBA [ 2 ] , RGBA [ 3 ]
@@ -838,7 +836,7 @@ proto.setViewport = function(sceneLayout) {
838
836
839
837
this . glplot . dispose ( ) ;
840
838
841
- initializeGLPlot ( this , pixelRatio ) ;
839
+ initializeGLPlot ( this ) ;
842
840
this . glplot . camera . _ortho = newOrtho ;
843
841
}
844
842
} ;
0 commit comments