Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 48d9e11

Browse filesBrowse files
committed
fixed modebar resetdefault and setCamera call in plot_api
1 parent 428bd1c commit 48d9e11
Copy full SHA for 48d9e11

File tree

2 files changed

+8
-2
lines changed
Filter options

2 files changed

+8
-2
lines changed

‎src/components/modebar/buttons.js

Copy file name to clipboardExpand all lines: src/components/modebar/buttons.js
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,10 @@ function handleCamera3d(gd, ev) {
348348
var scene = fullLayout[sceneId]._scene;
349349

350350
if(attr === 'resetDefault') {
351-
aobj[key] = null;
351+
aobj[key] = Lib.extendDeep({}, scene.cameraInitial);
352+
aobj[key].up = null;
353+
aobj[key].eye = null;
354+
aobj[key].center = null;
352355
}
353356
else if(attr === 'resetLastSave') {
354357
aobj[key] = Lib.extendDeep({}, scene.cameraInitial);

‎src/plot_api/subroutines.js

Copy file name to clipboardExpand all lines: src/plot_api/subroutines.js
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,10 @@ exports.doCamera = function(gd) {
600600
var sceneLayout = fullLayout[sceneIds[i]];
601601
var scene = sceneLayout._scene;
602602

603-
scene.setCamera(sceneLayout.camera);
603+
var cameraData = sceneLayout.camera;
604+
var isOrtho = !!(cameraData && cameraData.projection && cameraData.projection.type === 'orthographic');
605+
606+
scene.setCamera(cameraData, isOrtho);
604607
}
605608
};
606609

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.