Skip to content

Commit c9eed54

Browse files
committed
fix for restyle calls
1 parent 724416b commit c9eed54

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

src/plots/gl3d/layout/defaults.js

+19-17
Original file line numberDiff line numberDiff line change
@@ -101,25 +101,27 @@ function handleGl3dDefaults(sceneLayoutIn, sceneLayoutOut, coerce, opts) {
101101
sceneLayoutIn.dragmode = 'turntable';
102102
}
103103

104-
if(sceneLayoutIn.dragmode !== undefined) {
105-
// Because the default is now set to orbit mode
106-
// (i.e. in order to apply camera.z.up at init time)
107-
// we set turnable our disarable option here.
108-
109-
if(sceneLayoutIn.camera &&
110-
sceneLayoutIn.camera.up) {
111-
112-
var x = sceneLayoutIn.camera.up.x;
113-
var y = sceneLayoutIn.camera.up.y;
114-
var z = sceneLayoutIn.camera.up.z;
115-
116-
if(!x || !y || !z) {
117-
enableTurnTable();
118-
} else if(z / Math.sqrt(x * x + y * y + z * z) > 0.999) {
104+
if(sceneLayoutIn.dragmode !== false) {
105+
if(!sceneLayoutIn.dragmode) {
106+
// Because the default is now set to orbit mode
107+
// (i.e. in order to apply camera.z.up at init time)
108+
// we set turnable our disarable option here.
109+
110+
if(sceneLayoutIn.camera &&
111+
sceneLayoutIn.camera.up) {
112+
113+
var x = sceneLayoutIn.camera.up.x;
114+
var y = sceneLayoutIn.camera.up.y;
115+
var z = sceneLayoutIn.camera.up.z;
116+
117+
if(!x || !y || !z) {
118+
enableTurnTable();
119+
} else if(z / Math.sqrt(x * x + y * y + z * z) > 0.999) {
120+
enableTurnTable();
121+
}
122+
} else {
119123
enableTurnTable();
120124
}
121-
} else {
122-
enableTurnTable();
123125
}
124126
}
125127

0 commit comments

Comments
 (0)