fix(viewport): stop camera snapping back on slider changes - #19
Open
DaCameraGirl wants to merge 1 commit into
Open
fix(viewport): stop camera snapping back on slider changes#19DaCameraGirl wants to merge 1 commit into
DaCameraGirl wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.tsxavatar rebuild effect calledfitCameraToAvatar()unconditionally afterbuildAvatar(). SincefaceCanvasregenerates 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 separatecameraPreset/cameraFoveffect, which only runs when the user actually changes the camera view.Manual OrbitControls zoom/pan is now preserved across all config slider changes.