Make the Reset View button do the same view_isometric behavior as load (#6934)
* Make the Reset View button do the same view_isometric behavior as load Just copying some logic from the EngineStream code to make that button behave the same way: old initial camera position while in Playwright, isometric view for normal users. * Move duplicate code into shared `resetCameraPosition` function * Fix lints
This commit is contained in:
@ -13,6 +13,7 @@ import { VIEW_NAMES_SEMANTIC } from '@src/lib/constants'
|
||||
import { sceneInfra } from '@src/lib/singletons'
|
||||
import { reportRejection } from '@src/lib/trap'
|
||||
import { useSettings } from '@src/lib/singletons'
|
||||
import { resetCameraPosition } from '@src/lib/resetCameraPosition'
|
||||
|
||||
export function useViewControlMenuItems() {
|
||||
const { state: modelingState, send: modelingSend } = useModelingContext()
|
||||
@ -38,7 +39,7 @@ export function useViewControlMenuItems() {
|
||||
<ContextMenuDivider />,
|
||||
<ContextMenuItem
|
||||
onClick={() => {
|
||||
sceneInfra.camControls.resetCameraPosition().catch(reportRejection)
|
||||
resetCameraPosition().catch(reportRejection)
|
||||
}}
|
||||
disabled={shouldLockView}
|
||||
>
|
||||
|
Reference in New Issue
Block a user