Skip to content

Commit 7408232

Browse files
committed
dont add projection type in viewInitial
1 parent 8444b99 commit 7408232

File tree

3 files changed

+6
-16
lines changed

3 files changed

+6
-16
lines changed

src/components/modebar/buttons.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -358,13 +358,6 @@ function handleCamera3d(gd, ev) {
358358
aobj[key + '.eye'] = null;
359359
aobj[key + '.center'] = null;
360360
}
361-
362-
var newOrtho = (scene.viewInitial.projection.type === 'orthographic');
363-
var oldOrtho = scene.camera._ortho;
364-
365-
if(newOrtho !== oldOrtho) {
366-
aobj[key + '.projection'] = scene.viewInitial.projection;
367-
}
368361
}
369362

370363
Registry.call('_guiRelayout', gd, aobj);

src/plots/gl3d/index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@ exports.plot = function plotGl3d(gd) {
7070
// save 'initial' camera view settings for modebar button
7171
if(!scene.viewInitial) {
7272
scene.viewInitial = {
73-
projection: {
74-
type: camera.projection.type
75-
},
7673
up: {
7774
x: camera.up.x,
7875
y: camera.up.y,

test/jasmine/tests/gl3d_plot_interact_test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1490,7 +1490,7 @@ describe('Test gl3d relayout calls', function() {
14901490
.then(done);
14911491
});
14921492

1493-
it('@gl resetCamera buttons should be able to reset projection type after switching projection type from perspective to orthographic', function(done) {
1493+
it('@gl should maintain projection type when resetCamera buttons clicked after switching projection type from perspective to orthographic', function(done) {
14941494
Plotly.plot(gd, {
14951495
data: [{
14961496
type: 'surface',
@@ -1525,19 +1525,19 @@ describe('Test gl3d relayout calls', function() {
15251525
return selectButton(gd._fullLayout._modeBar, 'resetCameraLastSave3d').click();
15261526
})
15271527
.then(function() {
1528-
expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(false, 'perspective');
1528+
expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(true, 'orthographic');
15291529
})
15301530
.then(function() {
15311531
return selectButton(gd._fullLayout._modeBar, 'resetCameraDefault3d').click();
15321532
})
15331533
.then(function() {
1534-
expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(false, 'perspective');
1534+
expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(true, 'orthographic');
15351535
})
15361536
.catch(failTest)
15371537
.then(done);
15381538
});
15391539

1540-
it('@gl resetCamera buttons should be able to reset projection type after switching projection type from orthographic to perspective', function(done) {
1540+
it('@gl should maintain projection type when resetCamera buttons clicked after switching projection type from orthographic to perspective', function(done) {
15411541
Plotly.plot(gd, {
15421542
data: [{
15431543
type: 'surface',
@@ -1575,13 +1575,13 @@ describe('Test gl3d relayout calls', function() {
15751575
return selectButton(gd._fullLayout._modeBar, 'resetCameraLastSave3d').click();
15761576
})
15771577
.then(function() {
1578-
expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(true, 'orthographic');
1578+
expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(false, 'perspective');
15791579
})
15801580
.then(function() {
15811581
return selectButton(gd._fullLayout._modeBar, 'resetCameraDefault3d').click();
15821582
})
15831583
.then(function() {
1584-
expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(true, 'orthographic');
1584+
expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(false, 'perspective');
15851585
})
15861586
.catch(failTest)
15871587
.then(done);

0 commit comments

Comments
 (0)