Skip to content

Commit 0447a19

Browse files
committed
Bypassing most of the heavy lifting in the rAF for when there's no user interaction
1 parent 0dc3613 commit 0447a19

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/plots/gl2d/scene2d.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,11 @@ proto.draw = function() {
487487
this.lastPickResult.dataCoord[0] !== nextSelection.dataCoord[0] ||
488488
this.lastPickResult.dataCoord[1] !== nextSelection.dataCoord[1])
489489
) {
490-
var selection = this.lastPickResult = nextSelection;
490+
var selection = nextSelection;
491+
this.lastPickResult = {
492+
trace: nextSelection.trace, // could we just retain/compare the trace uid?
493+
dataCoord: nextSelection.dataCoord.slice()
494+
};
491495
this.spikes.update({ center: result.dataCoord });
492496

493497
selection.screenCoord = [
@@ -523,8 +527,6 @@ proto.draw = function() {
523527
}, {
524528
container: this.svgContainer
525529
});
526-
527-
this.lastPickResult = { dataCoord: result.dataCoord };
528530
}
529531
}
530532
else if(!result && this.lastPickResult) {

0 commit comments

Comments
 (0)