diff --git a/scene.js b/scene.js index 185e80e..93b22b7 100644 --- a/scene.js +++ b/scene.js @@ -534,6 +534,14 @@ function createScene(options) { prevBounds[1][j] = bounds[1][j] } + //Recalculate bounds + pickDirty = pickDirty || boundsChanged + dirty = dirty || boundsChanged + + if(!dirty) { + return + } + if(boundsChanged) { var tickSpacing = [0,0,0] for(var i=0; i<3; ++i) { @@ -551,10 +559,6 @@ function createScene(options) { } } - //Recalculate bounds - pickDirty = pickDirty || boundsChanged - dirty = dirty || boundsChanged - //Get scene var width = gl.drawingBufferWidth var height = gl.drawingBufferHeight @@ -604,7 +608,6 @@ function createScene(options) { obj.clipBounds = bounds } } - //Set spike parameters if(selection.object) { if(scene.snapToData) { @@ -621,10 +624,6 @@ function createScene(options) { renderPick() } - if(!dirty) { - return - } - //Recalculate pixel data scene.axesPixels = axesRanges(scene.axes, cameraParams, width, height)