Skip to content

fix: confetti disappearing in device_preview#104

Open
nivivon wants to merge 1 commit into
funwithflutter:masterfrom
nivivon:fix-device-preview
Open

fix: confetti disappearing in device_preview#104
nivivon wants to merge 1 commit into
funwithflutter:masterfrom
nivivon:fix-device-preview

Conversation

@nivivon
Copy link
Copy Markdown

@nivivon nivivon commented Apr 27, 2026

Why

I was working on integrating confetti into an app with device_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.

  • With device_preview turned off, see the confetti. Resize the window, and see that confetti still shoots out of the right place.
after.fix.-.web.mov
  • Using device_preview, see the confetti. Resize the window, and see that confetti still shoots out of the right place.
after.fix.-.mobile.mov

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 27, 2026

Deploy Preview for dazzling-euclid-7da31e failed.

Name Link
🔨 Latest commit 4fc55ed
🔍 Latest deploy log https://app.netlify.com/projects/dazzling-euclid-7da31e/deploys/69efce1a5dfc000008bbef76

@nivivon nivivon changed the title [FIX] Fix confetti disappearing in device_preview fix: confetti disappearing in device_preview Apr 28, 2026
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