From 58e47c4f18275d1c789682233552ed79e0f06fe6 Mon Sep 17 00:00:00 2001 From: archmoj Date: Sat, 2 Mar 2019 13:44:30 -0500 Subject: [PATCH 1/8] fixed reset camera to work after switching projection types --- src/components/modebar/buttons.js | 12 ++++++++---- src/plot_api/plot_api.js | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/components/modebar/buttons.js b/src/components/modebar/buttons.js index 294bc602b71..33f353ec991 100644 --- a/src/components/modebar/buttons.js +++ b/src/components/modebar/buttons.js @@ -347,15 +347,19 @@ function handleCamera3d(gd, ev) { var key = sceneId + '.camera'; var scene = fullLayout[sceneId]._scene; - if(attr === 'resetDefault') { + if(attr === 'resetDefault' || attr === 'resetLastSave') { aobj[key] = Lib.extendDeep({}, scene.cameraInitial); + + aobj[key].projection = { + type: (scene.camera._ortho) ? 'orthographic' : 'perspective' + }; + } + + if(attr === 'resetDefault') { aobj[key].up = null; aobj[key].eye = null; aobj[key].center = null; } - else if(attr === 'resetLastSave') { - aobj[key] = Lib.extendDeep({}, scene.cameraInitial); - } } Registry.call('_guiRelayout', gd, aobj); diff --git a/src/plot_api/plot_api.js b/src/plot_api/plot_api.js index c8e440b32fc..e2407f94fe8 100644 --- a/src/plot_api/plot_api.js +++ b/src/plot_api/plot_api.js @@ -1589,7 +1589,7 @@ function _restyle(gd, aobj, traces) { // and figure out what kind of graphics update we need to do for(var ai in aobj) { if(helpers.hasParent(aobj, ai)) { - throw new Error('cannot set ' + ai + 'and a parent attribute simultaneously'); + throw new Error('cannot set ' + ai + ' and a parent attribute simultaneously'); } var vi = aobj[ai]; @@ -2095,7 +2095,7 @@ function _relayout(gd, aobj) { // alter gd.layout for(var ai in aobj) { if(helpers.hasParent(aobj, ai)) { - throw new Error('cannot set ' + ai + 'and a parent attribute simultaneously'); + throw new Error('cannot set ' + ai + ' and a parent attribute simultaneously'); } var p = layoutNP(layout, ai); From 4d7c1b4c032b9a28174b48e856e0ba9bf5d2813c Mon Sep 17 00:00:00 2001 From: archmoj Date: Sat, 2 Mar 2019 19:25:16 -0500 Subject: [PATCH 2/8] added jasmine tests to lock issue 3596 --- test/jasmine/tests/gl3d_plot_interact_test.js | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) diff --git a/test/jasmine/tests/gl3d_plot_interact_test.js b/test/jasmine/tests/gl3d_plot_interact_test.js index dbed484ca3c..9c77635eb8e 100644 --- a/test/jasmine/tests/gl3d_plot_interact_test.js +++ b/test/jasmine/tests/gl3d_plot_interact_test.js @@ -1489,6 +1489,103 @@ describe('Test gl3d relayout calls', function() { .catch(failTest) .then(done); }); + + it('@gl should maintain projection type when resetCamera buttons clicked after switching projection type from perspective to orthographic', function(done) { + Plotly.plot(gd, { + data: [{ + type: 'surface', + x: [0, 1], + y: [0, 1], + z: [[0, 1], [1, 0]] + }], + layout: { + width: 300, + height: 200, + scene: { + camera: { + eye: { + x: 2, + y: 1, + z: 0.5 + } + } + } + } + }) + .then(function() { + expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(false, 'perspective'); + }) + .then(function() { + return Plotly.relayout(gd, 'scene.camera.projection.type', 'orthographic'); + }) + .then(function() { + expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(true, 'orthographic'); + }) + .then(function() { + return selectButton(gd._fullLayout._modeBar, 'resetCameraLastSave3d').click(); + }) + .then(function() { + expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(true, 'orthographic'); + }) + .then(function() { + return selectButton(gd._fullLayout._modeBar, 'resetCameraDefault3d').click(); + }) + .then(function() { + expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(true, 'orthographic'); + }) + .catch(failTest) + .then(done); + }); + + it('@gl should maintain projection type when resetCamera buttons clicked after switching projection type from orthographic to perspective', function(done) { + Plotly.plot(gd, { + data: [{ + type: 'surface', + x: [0, 1], + y: [0, 1], + z: [[0, 1], [1, 0]] + }], + layout: { + width: 300, + height: 200, + scene: { + camera: { + eye: { + x: 2, + y: 1, + z: 0.5 + }, + projection: { + type: 'orthographic' + } + } + } + } + }) + .then(function() { + expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(true, 'orthographic'); + }) + .then(function() { + return Plotly.relayout(gd, 'scene.camera.projection.type', 'perspective'); + }) + .then(function() { + expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(false, 'perspective'); + }) + .then(function() { + return selectButton(gd._fullLayout._modeBar, 'resetCameraLastSave3d').click(); + }) + .then(function() { + expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(false, 'perspective'); + }) + .then(function() { + return selectButton(gd._fullLayout._modeBar, 'resetCameraDefault3d').click(); + }) + .then(function() { + expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(false, 'perspective'); + }) + .catch(failTest) + .then(done); + }); }); describe('Test gl3d annotations', function() { From 9e1aa7af86a8dab6e807e8ddea8dca826031cc41 Mon Sep 17 00:00:00 2001 From: archmoj Date: Mon, 4 Mar 2019 17:25:42 -0500 Subject: [PATCH 3/8] cameraInitial > viewInitial --- src/components/modebar/buttons.js | 2 +- src/plots/gl3d/index.js | 22 ++++++++++++++++--- test/jasmine/tests/gl3d_plot_interact_test.js | 8 +++---- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/components/modebar/buttons.js b/src/components/modebar/buttons.js index 33f353ec991..eac6f5e4f08 100644 --- a/src/components/modebar/buttons.js +++ b/src/components/modebar/buttons.js @@ -348,7 +348,7 @@ function handleCamera3d(gd, ev) { var scene = fullLayout[sceneId]._scene; if(attr === 'resetDefault' || attr === 'resetLastSave') { - aobj[key] = Lib.extendDeep({}, scene.cameraInitial); + aobj[key] = Lib.extendDeep({}, scene.viewInitial); aobj[key].projection = { type: (scene.camera._ortho) ? 'orthographic' : 'perspective' diff --git a/src/plots/gl3d/index.js b/src/plots/gl3d/index.js index c99979d7b98..410d69896e9 100644 --- a/src/plots/gl3d/index.js +++ b/src/plots/gl3d/index.js @@ -67,9 +67,25 @@ exports.plot = function plotGl3d(gd) { sceneLayout._scene = scene; } - // save 'initial' camera settings for modebar button - if(!scene.cameraInitial) { - scene.cameraInitial = Lib.extendDeep({}, sceneLayout.camera); + // save 'initial' camera view settings for modebar button + if(!scene.viewInitial) { + scene.viewInitial = { + up: { + x: sceneLayout.camera.up.x, + y: sceneLayout.camera.up.y, + z: sceneLayout.camera.up.z + }, + eye: { + x: sceneLayout.camera.eye.x, + y: sceneLayout.camera.eye.y, + z: sceneLayout.camera.eye.z + }, + center: { + x: sceneLayout.camera.center.x, + y: sceneLayout.camera.center.y, + z: sceneLayout.camera.center.z + } + }; } scene.plot(fullSceneData, fullLayout, gd.layout); diff --git a/test/jasmine/tests/gl3d_plot_interact_test.js b/test/jasmine/tests/gl3d_plot_interact_test.js index 9c77635eb8e..50e1ba3e21b 100644 --- a/test/jasmine/tests/gl3d_plot_interact_test.js +++ b/test/jasmine/tests/gl3d_plot_interact_test.js @@ -1043,8 +1043,8 @@ describe('Test gl3d modebar handlers', function() { it('@gl button resetCameraDefault3d should reset camera to default', function(done) { var buttonDefault = selectButton(modeBar, 'resetCameraDefault3d'); - expect(gd._fullLayout.scene._scene.cameraInitial.eye).toEqual({ x: 0.1, y: 0.1, z: 1 }); - expect(gd._fullLayout.scene2._scene.cameraInitial.eye).toEqual({ x: 2.5, y: 2.5, z: 2.5 }); + expect(gd._fullLayout.scene._scene.viewInitial.eye).toEqual({ x: 0.1, y: 0.1, z: 1 }); + expect(gd._fullLayout.scene2._scene.viewInitial.eye).toEqual({ x: 2.5, y: 2.5, z: 2.5 }); gd.once('plotly_relayout', function() { assertScenes(gd._fullLayout, 'camera.eye.x', 1.25); @@ -1099,8 +1099,8 @@ describe('Test gl3d modebar handlers', function() { assertCameraEye(gd._fullLayout.scene, 0.1, 0.1, 1); assertCameraEye(gd._fullLayout.scene2, 2.5, 2.5, 2.5); - delete gd._fullLayout.scene._scene.cameraInitial; - delete gd._fullLayout.scene2._scene.cameraInitial; + delete gd._fullLayout.scene._scene.viewInitial; + delete gd._fullLayout.scene2._scene.viewInitial; Plotly.relayout(gd, { 'scene.bgcolor': '#d3d3d3', From 5dfdbcff2dc6a75ff998293a1d315d4edb311341 Mon Sep 17 00:00:00 2001 From: archmoj Date: Mon, 4 Mar 2019 18:52:03 -0500 Subject: [PATCH 4/8] edited aobj --- src/components/modebar/buttons.js | 12 ++++++++---- src/plots/gl3d/index.js | 18 +++++++++--------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/components/modebar/buttons.js b/src/components/modebar/buttons.js index eac6f5e4f08..09c3cf1353f 100644 --- a/src/components/modebar/buttons.js +++ b/src/components/modebar/buttons.js @@ -348,10 +348,14 @@ function handleCamera3d(gd, ev) { var scene = fullLayout[sceneId]._scene; if(attr === 'resetDefault' || attr === 'resetLastSave') { - aobj[key] = Lib.extendDeep({}, scene.viewInitial); - - aobj[key].projection = { - type: (scene.camera._ortho) ? 'orthographic' : 'perspective' + aobj[key] = { + 'up': scene.viewInitial.up, + 'eye': scene.viewInitial.eye, + 'center': scene.viewInitial.center, + 'projection': { + type: (scene.camera._ortho) ? + 'orthographic' : 'perspective' + } }; } diff --git a/src/plots/gl3d/index.js b/src/plots/gl3d/index.js index 410d69896e9..55c390b7619 100644 --- a/src/plots/gl3d/index.js +++ b/src/plots/gl3d/index.js @@ -71,19 +71,19 @@ exports.plot = function plotGl3d(gd) { if(!scene.viewInitial) { scene.viewInitial = { up: { - x: sceneLayout.camera.up.x, - y: sceneLayout.camera.up.y, - z: sceneLayout.camera.up.z + x: camera.up.x, + y: camera.up.y, + z: camera.up.z }, eye: { - x: sceneLayout.camera.eye.x, - y: sceneLayout.camera.eye.y, - z: sceneLayout.camera.eye.z + x: camera.eye.x, + y: camera.eye.y, + z: camera.eye.z }, center: { - x: sceneLayout.camera.center.x, - y: sceneLayout.camera.center.y, - z: sceneLayout.camera.center.z + x: camera.center.x, + y: camera.center.y, + z: camera.center.z } }; } From eb8737b9c2f89b71ffcf1ba6c82bc18bc1c44110 Mon Sep 17 00:00:00 2001 From: archmoj Date: Tue, 5 Mar 2019 09:52:57 -0500 Subject: [PATCH 5/8] no need to pass gl3d projection type in calls --- src/components/modebar/buttons.js | 25 +++++++++---------------- src/plots/gl3d/scene.js | 8 ++++---- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/src/components/modebar/buttons.js b/src/components/modebar/buttons.js index 09c3cf1353f..612004c3a37 100644 --- a/src/components/modebar/buttons.js +++ b/src/components/modebar/buttons.js @@ -347,22 +347,15 @@ function handleCamera3d(gd, ev) { var key = sceneId + '.camera'; var scene = fullLayout[sceneId]._scene; - if(attr === 'resetDefault' || attr === 'resetLastSave') { - aobj[key] = { - 'up': scene.viewInitial.up, - 'eye': scene.viewInitial.eye, - 'center': scene.viewInitial.center, - 'projection': { - type: (scene.camera._ortho) ? - 'orthographic' : 'perspective' - } - }; - } - - if(attr === 'resetDefault') { - aobj[key].up = null; - aobj[key].eye = null; - aobj[key].center = null; + if(attr === 'resetLastSave') { + aobj[key + '.up'] = scene.viewInitial.up; + aobj[key + '.eye'] = scene.viewInitial.eye; + aobj[key + '.center'] = scene.viewInitial.center; + + } else if(attr === 'resetDefault') { + aobj[key + '.up'] = null; + aobj[key + '.eye'] = null; + aobj[key + '.center'] = null; } } diff --git a/src/plots/gl3d/scene.js b/src/plots/gl3d/scene.js index d7cc4bff620..c1ba16cee4d 100644 --- a/src/plots/gl3d/scene.js +++ b/src/plots/gl3d/scene.js @@ -255,7 +255,7 @@ function initializeGLPlot(scene, camera, pixelRatio, canvas, gl) { if(scene.fullSceneLayout.dragmode === false) return; var update = {}; - update[scene.id + '.camera'] = getLayoutCamera(scene.camera, scene.camera._ortho); + update[scene.id + '.camera'] = getLayoutCamera(scene.camera); scene.saveCamera(gd.layout); scene.graphDiv.emit('plotly_relayout', update); }; @@ -758,19 +758,19 @@ function getOrbitCamera(camera) { // getLayoutCamera :: orbit_camera_coords -> plotly_coords // inverse of getOrbitCamera -function getLayoutCamera(camera, isOrtho) { +function getLayoutCamera(camera) { return { up: {x: camera.up[0], y: camera.up[1], z: camera.up[2]}, center: {x: camera.center[0], y: camera.center[1], z: camera.center[2]}, eye: {x: camera.eye[0], y: camera.eye[1], z: camera.eye[2]}, - projection: {type: (isOrtho === true) ? 'orthographic' : 'perspective'} + projection: {type: (camera._ortho === true) ? 'orthographic' : 'perspective'} }; } // get camera position in plotly coords from 'orbit-camera' coords proto.getCamera = function getCamera() { this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()); - return getLayoutCamera(this.glplot.camera, this.glplot.camera._ortho); + return getLayoutCamera(this.glplot.camera); }; // set camera position with a set of plotly coords From 8444b99579fa42834b2cf8ab45dffa865e31b584 Mon Sep 17 00:00:00 2001 From: archmoj Date: Tue, 5 Mar 2019 10:21:07 -0500 Subject: [PATCH 6/8] modebar now able to switch projection type --- src/components/modebar/buttons.js | 10 +++++++++- src/plots/gl3d/index.js | 3 +++ test/jasmine/tests/gl3d_plot_interact_test.js | 12 ++++++------ 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/components/modebar/buttons.js b/src/components/modebar/buttons.js index 612004c3a37..e243668dab1 100644 --- a/src/components/modebar/buttons.js +++ b/src/components/modebar/buttons.js @@ -338,6 +338,8 @@ modeBarButtons.resetCameraLastSave3d = { function handleCamera3d(gd, ev) { var button = ev.currentTarget; var attr = button.getAttribute('data-attr'); + if(attr !== 'resetLastSave' && attr !== 'resetDefault') return; + var fullLayout = gd._fullLayout; var sceneIds = fullLayout._subplots.gl3d; var aobj = {}; @@ -351,12 +353,18 @@ function handleCamera3d(gd, ev) { aobj[key + '.up'] = scene.viewInitial.up; aobj[key + '.eye'] = scene.viewInitial.eye; aobj[key + '.center'] = scene.viewInitial.center; - } else if(attr === 'resetDefault') { aobj[key + '.up'] = null; aobj[key + '.eye'] = null; aobj[key + '.center'] = null; } + + var newOrtho = (scene.viewInitial.projection.type === 'orthographic'); + var oldOrtho = scene.camera._ortho; + + if(newOrtho !== oldOrtho) { + aobj[key + '.projection'] = scene.viewInitial.projection; + } } Registry.call('_guiRelayout', gd, aobj); diff --git a/src/plots/gl3d/index.js b/src/plots/gl3d/index.js index 55c390b7619..b00c72e18a5 100644 --- a/src/plots/gl3d/index.js +++ b/src/plots/gl3d/index.js @@ -70,6 +70,9 @@ exports.plot = function plotGl3d(gd) { // save 'initial' camera view settings for modebar button if(!scene.viewInitial) { scene.viewInitial = { + projection: { + type: camera.projection.type + }, up: { x: camera.up.x, y: camera.up.y, diff --git a/test/jasmine/tests/gl3d_plot_interact_test.js b/test/jasmine/tests/gl3d_plot_interact_test.js index 50e1ba3e21b..ed6abbe3c9e 100644 --- a/test/jasmine/tests/gl3d_plot_interact_test.js +++ b/test/jasmine/tests/gl3d_plot_interact_test.js @@ -1490,7 +1490,7 @@ describe('Test gl3d relayout calls', function() { .then(done); }); - it('@gl should maintain projection type when resetCamera buttons clicked after switching projection type from perspective to orthographic', function(done) { + it('@gl resetCamera buttons should be able to reset projection type after switching projection type from perspective to orthographic', function(done) { Plotly.plot(gd, { data: [{ type: 'surface', @@ -1525,19 +1525,19 @@ describe('Test gl3d relayout calls', function() { return selectButton(gd._fullLayout._modeBar, 'resetCameraLastSave3d').click(); }) .then(function() { - expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(true, 'orthographic'); + expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(false, 'perspective'); }) .then(function() { return selectButton(gd._fullLayout._modeBar, 'resetCameraDefault3d').click(); }) .then(function() { - expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(true, 'orthographic'); + expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(false, 'perspective'); }) .catch(failTest) .then(done); }); - it('@gl should maintain projection type when resetCamera buttons clicked after switching projection type from orthographic to perspective', function(done) { + it('@gl resetCamera buttons should be able to reset projection type after switching projection type from orthographic to perspective', function(done) { Plotly.plot(gd, { data: [{ type: 'surface', @@ -1575,13 +1575,13 @@ describe('Test gl3d relayout calls', function() { return selectButton(gd._fullLayout._modeBar, 'resetCameraLastSave3d').click(); }) .then(function() { - expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(false, 'perspective'); + expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(true, 'orthographic'); }) .then(function() { return selectButton(gd._fullLayout._modeBar, 'resetCameraDefault3d').click(); }) .then(function() { - expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(false, 'perspective'); + expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(true, 'orthographic'); }) .catch(failTest) .then(done); From 74082325792cfcf409c6b55d56397dd068d0a7f1 Mon Sep 17 00:00:00 2001 From: archmoj Date: Tue, 5 Mar 2019 11:24:13 -0500 Subject: [PATCH 7/8] dont add projection type in viewInitial --- src/components/modebar/buttons.js | 7 ------- src/plots/gl3d/index.js | 3 --- test/jasmine/tests/gl3d_plot_interact_test.js | 12 ++++++------ 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/components/modebar/buttons.js b/src/components/modebar/buttons.js index e243668dab1..8a6fe0d55dd 100644 --- a/src/components/modebar/buttons.js +++ b/src/components/modebar/buttons.js @@ -358,13 +358,6 @@ function handleCamera3d(gd, ev) { aobj[key + '.eye'] = null; aobj[key + '.center'] = null; } - - var newOrtho = (scene.viewInitial.projection.type === 'orthographic'); - var oldOrtho = scene.camera._ortho; - - if(newOrtho !== oldOrtho) { - aobj[key + '.projection'] = scene.viewInitial.projection; - } } Registry.call('_guiRelayout', gd, aobj); diff --git a/src/plots/gl3d/index.js b/src/plots/gl3d/index.js index b00c72e18a5..55c390b7619 100644 --- a/src/plots/gl3d/index.js +++ b/src/plots/gl3d/index.js @@ -70,9 +70,6 @@ exports.plot = function plotGl3d(gd) { // save 'initial' camera view settings for modebar button if(!scene.viewInitial) { scene.viewInitial = { - projection: { - type: camera.projection.type - }, up: { x: camera.up.x, y: camera.up.y, diff --git a/test/jasmine/tests/gl3d_plot_interact_test.js b/test/jasmine/tests/gl3d_plot_interact_test.js index ed6abbe3c9e..50e1ba3e21b 100644 --- a/test/jasmine/tests/gl3d_plot_interact_test.js +++ b/test/jasmine/tests/gl3d_plot_interact_test.js @@ -1490,7 +1490,7 @@ describe('Test gl3d relayout calls', function() { .then(done); }); - it('@gl resetCamera buttons should be able to reset projection type after switching projection type from perspective to orthographic', function(done) { + it('@gl should maintain projection type when resetCamera buttons clicked after switching projection type from perspective to orthographic', function(done) { Plotly.plot(gd, { data: [{ type: 'surface', @@ -1525,19 +1525,19 @@ describe('Test gl3d relayout calls', function() { return selectButton(gd._fullLayout._modeBar, 'resetCameraLastSave3d').click(); }) .then(function() { - expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(false, 'perspective'); + expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(true, 'orthographic'); }) .then(function() { return selectButton(gd._fullLayout._modeBar, 'resetCameraDefault3d').click(); }) .then(function() { - expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(false, 'perspective'); + expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(true, 'orthographic'); }) .catch(failTest) .then(done); }); - it('@gl resetCamera buttons should be able to reset projection type after switching projection type from orthographic to perspective', function(done) { + it('@gl should maintain projection type when resetCamera buttons clicked after switching projection type from orthographic to perspective', function(done) { Plotly.plot(gd, { data: [{ type: 'surface', @@ -1575,13 +1575,13 @@ describe('Test gl3d relayout calls', function() { return selectButton(gd._fullLayout._modeBar, 'resetCameraLastSave3d').click(); }) .then(function() { - expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(true, 'orthographic'); + expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(false, 'perspective'); }) .then(function() { return selectButton(gd._fullLayout._modeBar, 'resetCameraDefault3d').click(); }) .then(function() { - expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(true, 'orthographic'); + expect(gd._fullLayout.scene._scene.camera._ortho).toEqual(false, 'perspective'); }) .catch(failTest) .then(done); From 3c37554a58cbd04db792f6b1ad4ff3a35f8f733c Mon Sep 17 00:00:00 2001 From: archmoj Date: Tue, 5 Mar 2019 11:39:35 -0500 Subject: [PATCH 8/8] handleCamera3d rm interface check --- src/components/modebar/buttons.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/modebar/buttons.js b/src/components/modebar/buttons.js index 8a6fe0d55dd..82422887afb 100644 --- a/src/components/modebar/buttons.js +++ b/src/components/modebar/buttons.js @@ -338,8 +338,6 @@ modeBarButtons.resetCameraLastSave3d = { function handleCamera3d(gd, ev) { var button = ev.currentTarget; var attr = button.getAttribute('data-attr'); - if(attr !== 'resetLastSave' && attr !== 'resetDefault') return; - var fullLayout = gd._fullLayout; var sceneIds = fullLayout._subplots.gl3d; var aobj = {};