This repository was archived by the owner on Apr 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -336,29 +336,19 @@ modeBarButtons.resetCameraLastSave3d = {
336
336
function handleCamera3d ( gd , ev ) {
337
337
var button = ev . currentTarget ,
338
338
attr = button . getAttribute ( 'data-attr' ) ,
339
- layout = gd . layout ,
340
339
fullLayout = gd . _fullLayout ,
341
340
sceneIds = Plotly . Plots . getSubplotIds ( fullLayout , 'gl3d' ) ;
342
341
343
342
for ( var i = 0 ; i < sceneIds . length ; i ++ ) {
344
343
var sceneId = sceneIds [ i ] ,
345
- sceneLayout = layout [ sceneId ] ,
346
344
fullSceneLayout = fullLayout [ sceneId ] ,
347
345
scene = fullSceneLayout . _scene ;
348
346
349
- if ( ! sceneLayout || attr === 'resetDefault' ) scene . setCameraToDefault ( ) ;
347
+ if ( attr === 'resetDefault' ) scene . setCameraToDefault ( ) ;
350
348
else if ( attr === 'resetLastSave' ) {
351
-
352
- var cameraPos = sceneLayout . camera ;
353
- if ( cameraPos ) scene . setCamera ( cameraPos ) ;
354
- else scene . setCameraToDefault ( ) ;
349
+ scene . setCamera ( fullSceneLayout . camera ) ;
355
350
}
356
351
}
357
-
358
- /*
359
- * TODO have a sceneLastTouched in _fullLayout to only
360
- * update the camera of the scene last touched by the user
361
- */
362
352
}
363
353
364
354
modeBarButtons . hoverClosest3d = {
You can’t perform that action at this time.
0 commit comments