Skip to content

Commit 5dfdbcf

Browse files
committed
edited aobj
1 parent 9e1aa7a commit 5dfdbcf

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

src/components/modebar/buttons.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,10 +348,14 @@ function handleCamera3d(gd, ev) {
348348
var scene = fullLayout[sceneId]._scene;
349349

350350
if(attr === 'resetDefault' || attr === 'resetLastSave') {
351-
aobj[key] = Lib.extendDeep({}, scene.viewInitial);
352-
353-
aobj[key].projection = {
354-
type: (scene.camera._ortho) ? 'orthographic' : 'perspective'
351+
aobj[key] = {
352+
'up': scene.viewInitial.up,
353+
'eye': scene.viewInitial.eye,
354+
'center': scene.viewInitial.center,
355+
'projection': {
356+
type: (scene.camera._ortho) ?
357+
'orthographic' : 'perspective'
358+
}
355359
};
356360
}
357361

src/plots/gl3d/index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,19 @@ exports.plot = function plotGl3d(gd) {
7171
if(!scene.viewInitial) {
7272
scene.viewInitial = {
7373
up: {
74-
x: sceneLayout.camera.up.x,
75-
y: sceneLayout.camera.up.y,
76-
z: sceneLayout.camera.up.z
74+
x: camera.up.x,
75+
y: camera.up.y,
76+
z: camera.up.z
7777
},
7878
eye: {
79-
x: sceneLayout.camera.eye.x,
80-
y: sceneLayout.camera.eye.y,
81-
z: sceneLayout.camera.eye.z
79+
x: camera.eye.x,
80+
y: camera.eye.y,
81+
z: camera.eye.z
8282
},
8383
center: {
84-
x: sceneLayout.camera.center.x,
85-
y: sceneLayout.camera.center.y,
86-
z: sceneLayout.camera.center.z
84+
x: camera.center.x,
85+
y: camera.center.y,
86+
z: camera.center.z
8787
}
8888
};
8989
}

0 commit comments

Comments
 (0)