mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:50:52 +01:00
[PR #1490] studio: reset the camera to the current model's fitted view #1522
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1522
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1490
Author: @xel1uz
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/studio-reset-camera📝 Commits (1)
662f8c3studio: reset the camera to the current model's fitted view📊 Changes
2 files changed (+36 additions, -6 deletions)
View changed files
📝
tests/test_viewer_studio.cjs(+35 -6)📝
viewer/studio.html(+1 -0)📄 Description
Claimed in the coordination issue as: STUDIO-RESET-CAMERA-FIT
What and why
Load a large model in Studio, orbit or pan away, then click Reset Camera. On
mainthe camera returns to the position captured when Studio initialized. With a 20-unit cube, the model initially fits at(30, 24, 36)but Reset moves the camera to(0, 2, 5), inside the cube.Save the OrbitControls state after a successful model load fits the camera and updates its target. Reset now returns to the fitted view of the displayed model, including after switching models.
Tested
viewer/studio.htmlat5a5df8e0b6. It failed at the first reset (expected the fitted view, got the startup position). With this change the test restores both the camera position and the orbit target after each of two model loads.(30, 24, 36)and the 6-unit cube to(9, 7.2, 10.8), both looking at the origin. On the original page the same clicks returned both cubes to(0, 2, 5). Both GLBs were generated locally.node --test "tests/test_*.cjs"(Node 24.18.0): 70 passed, including all 13 Studio tests.python -I scripts/run_semantic_tests.py tests/semantic -j 12: 6,223 tests across 476 files, zero failing files (396 s).git diff --checkandpython -I scripts/check_no_game_data.py viewer/studio.html tests/test_viewer_studio.cjspassed.GPUs tested: Chrome used ANGLE/Vulkan SwiftShader (software rendering) on Windows. No physical GPU tested.
AI-assisted: Yes.
Checklist
mainat5a5df8e0b6.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.