fix: confetti disappearing in device_preview#104
Open
nivivon wants to merge 1 commit into
Open
Conversation
❌ Deploy Preview for dazzling-euclid-7da31e failed.
|
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.
Why
I was working on integrating
confettiinto an app withdevice_preview. Currently, it seems that it doesn't show confetti in the right place. This seems to be a position issue.The confetti layer was using two different ways to measure "where a particle is": local positions and global screen position. They don't match when the app is drawn in a special container (for example,
device_preview), so the engine thought every particle was already off-screen and removed it right away. Culling is now done in the same local space the particles are drawn in, and the old global-position path was removed because it’s no longer needed.Here's a video that showcases the bug:
confetti.bug.mov
I know the last commit is from
Sep 28, 2024, which means this may not be reviewed. That said, leaving this just in case anyone runs into the issue. 😄How I Tested
Add
device_preview.device_previewturned off, see the confetti. Resize the window, and see that confetti still shoots out of the right place.after.fix.-.web.mov
device_preview, see the confetti. Resize the window, and see that confetti still shoots out of the right place.after.fix.-.mobile.mov