Skip to content

Spare some CPU load in idle case #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
Expand Down Expand Up @@ -604,7 +608,6 @@ function createScene(options) {
obj.clipBounds = bounds
}
}

//Set spike parameters
if(selection.object) {
if(scene.snapToData) {
Expand All @@ -621,10 +624,6 @@ function createScene(options) {
renderPick()
}

if(!dirty) {
return
}

//Recalculate pixel data
scene.axesPixels = axesRanges(scene.axes, cameraParams, width, height)

Expand Down