Preserve gl3d scene aspectratio after orthographic scroll zoom - #4578
Conversation
… for restyle interactions
| aspectRatio = [1, 1, 1]; | ||
| } | ||
| } else if(fullSceneLayout.aspectmode === 'cube') { | ||
| var aspectmode = scene._aspectmode || fullSceneLayout.aspectmode; |
There was a problem hiding this comment.
What's the difference between scene._aspectmode and fullSceneLayout.aspectmode ?
There was a problem hiding this comment.
scene._aspectmode is an internal variable which is set after aspectratio values are computed.
There was a problem hiding this comment.
Are there situations where scene._aspectmode and fullSceneLayout.aspectmode aren't the same?
There was a problem hiding this comment.
There is. Namely after using scroll zoom.
There was a problem hiding this comment.
Ok, but shouldn't the changes to aspectmode during scroll zoom propagate to fullLayout ?
There was a problem hiding this comment.
I initially tried to achieve that on another branch using relayout updates.
Since tests started failing, I thought that may not be ideal to override fullLayout in this case.
There was a problem hiding this comment.
I'm curious. Which tests fail?
There was a problem hiding this comment.
Are there situations where
scene._aspectmodeandfullSceneLayout.aspectmodearen't the same?
OK. This time I was able to make that work without a temporary variable: 1828797
|
Brilliant. 💃 ! |
Fixes #4514 restyle part
After refactoring parts of the gl3d/scene code related to computing
aspectratio,this PR fixes the bug in commit e29aceb.
Demo | Please change scales using scroll, then select a point. It shouldn't display initial scales.
@plotly/plotly_js