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:
Frank Noirot
2025-05-14 15:01:45 -04:00
committed by GitHub
parent 5c2dfb8e40
commit b23fc9f623
3 changed files with 44 additions and 33 deletions

View File

@ -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}
>