Skip to content

Commit b81885d

Browse files
committed
avoid trying to call scene.clear more than once per mousemove
... that is move scene.clear() out of trace-type loop
1 parent c3044e0 commit b81885d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/plots/polar/polar.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -988,18 +988,17 @@ proto.updateRadialDrag = function(fullLayout, polarLayout) {
988988
_this.xaxis.setScale();
989989
_this.yaxis.setScale();
990990

991-
for(var k in _this.traceHash) {
992-
var moduleCalcData = _this.traceHash[k];
991+
if(_this._scene) _this._scene.clear();
992+
993+
for(var traceType in _this.traceHash) {
994+
var moduleCalcData = _this.traceHash[traceType];
993995
var moduleCalcDataVisible = Lib.filterVisible(moduleCalcData);
994996
var _module = moduleCalcData[0][0].trace._module;
995997
var polarLayoutNow = gd._fullLayout[_this.id];
996-
var isGL = Registry.traceIs(k, 'gl');
997-
998-
if(isGL && _this._scene) _this._scene.clear();
999998

1000999
_module.plot(gd, _this, moduleCalcDataVisible, polarLayoutNow);
10011000

1002-
if(!isGL) {
1001+
if(!Registry.traceIs(traceType, 'gl')) {
10031002
for(var i = 0; i < moduleCalcDataVisible.length; i++) {
10041003
_module.style(gd, moduleCalcDataVisible[i]);
10051004
}
@@ -1134,12 +1133,13 @@ proto.updateAngularDrag = function(fullLayout, polarLayout) {
11341133
scatterTraces.call(Drawing.hideOutsideRangePoints, _this);
11351134
}
11361135

1137-
for(var k in _this.traceHash) {
1138-
if(Registry.traceIs(k, 'gl')) {
1139-
var moduleCalcData = _this.traceHash[k];
1136+
if(_this._scene) _this._scene.clear();
1137+
1138+
for(var traceType in _this.traceHash) {
1139+
if(Registry.traceIs(traceType, 'gl')) {
1140+
var moduleCalcData = _this.traceHash[traceType];
11401141
var moduleCalcDataVisible = Lib.filterVisible(moduleCalcData);
11411142
var _module = moduleCalcData[0][0].trace._module;
1142-
if(_this._scene) _this._scene.clear();
11431143
_module.plot(gd, _this, moduleCalcDataVisible, polarLayoutNow);
11441144
}
11451145
}

0 commit comments

Comments
 (0)