Skip to content

fix(viewport): stop camera snapping back on slider changes - #19

Open
DaCameraGirl wants to merge 1 commit into
mainfrom
fix/camera-jump-on-slider
Open

fix(viewport): stop camera snapping back on slider changes#19
DaCameraGirl wants to merge 1 commit into
mainfrom
fix/camera-jump-on-slider

Conversation

@DaCameraGirl

Copy link
Copy Markdown
Owner

Every slider tweak (feather, crop, colors, morph, etc.) was snapping the 3D viewport camera back to the default framed distance, destroying the user's manual zoom/pan position.

Root cause: ThreeCanvas.tsx avatar rebuild effect called fitCameraToAvatar() unconditionally after buildAvatar(). Since faceCanvas regenerates on every feather/crop change, the rebuild effect fired constantly.

Fix: Remove fitCameraToAvatar() from the avatar rebuild effect. Camera framing is already handled by the separate cameraPreset/cameraFov effect, which only runs when the user actually changes the camera view.

Manual OrbitControls zoom/pan is now preserved across all config slider changes.

Every slider tweak (feather, crop, colors, morph, etc.) was
nuking the user's OrbitControls zoom/pan position.

Root cause: ThreeCanvas avatar rebuild effect called
fitCameraToAvatar() unconditionally after buildAvatar().
Since faceCanvas regenerates on every feather/crop change,
the avatar rebuild effect fired constantly, snapping the
camera back to the default framed distance each time.

Fix: Remove fitCameraToAvatar() from the avatar rebuild
effect. Camera framing is already handled separately by
the cameraPreset/cameraFov effect, which is the correct
place - it only runs when the user actually changes the
camera view, not on every material/texture/geometry tweak.

The user's manual zoom/scroll position is now preserved
across all config slider changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant