Skip to content

Conversation

@seveibar
Copy link
Contributor

Summary

  • rename the orthographic camera boolean to shouldUseOrthographicCamera across viewer components
  • update the context menu and viewer containers to use the renamed flag while preserving local storage behavior

Testing

  • bunx tsc --noEmit

https://chatgpt.com/codex/tasks/task_b_6904dfb631b0832eb8f215c892938f78

@vercel
Copy link

vercel bot commented Oct 31, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
3d-viewer Ready Ready Preview Comment Nov 1, 2025 4:38pm
@seveibar seveibar changed the title Rename orthographic camera flag to shouldUseOrthographicCamera Introduce Orthographic camera toggle Oct 31, 2025
Comment on lines 11 to +14
if (typeof window !== "undefined") {
window.TSCI_MAIN_CAMERA_ROTATION = new THREE.Euler(0, 0, 0)
window.TSCI_MAIN_CAMERA_QUATERNION = new THREE.Quaternion()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Global window properties are unconditionally overwritten with new instances, while CadViewerContainer.tsx uses nullish coalescing assignment (??=). This creates an inconsistency where loading order matters.

If this file loads after CadViewerContainer.tsx, it will reset the global camera state, causing the RotationTracker's updates to be lost.

Fix:

window.TSCI_MAIN_CAMERA_ROTATION ??= new THREE.Euler(0, 0, 0) window.TSCI_MAIN_CAMERA_QUATERNION ??= new THREE.Quaternion()
Suggested change
if (typeof window !== "undefined") {
window.TSCI_MAIN_CAMERA_ROTATION = new THREE.Euler(0, 0, 0)
window.TSCI_MAIN_CAMERA_QUATERNION = new THREE.Quaternion()
if (typeof window !== "undefined") {
window.TSCI_MAIN_CAMERA_ROTATION ??= new THREE.Euler(0, 0, 0)
window.TSCI_MAIN_CAMERA_QUATERNION ??= new THREE.Quaternion()

Spotted by Graphite Agent

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@seveibar
Copy link
Contributor Author

seveibar commented Nov 2, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants