Skip to content

Nondeterministic layout bug #60

Open
@pocketpixels

Description

Hi,
I am using the WaterfallGrid to layout thumbnails of different aspect ratios. The data (including the JPEG data for the thumbnail images) comes from a local database (using GRDB). But it is read synchronously on the main thread, and the order (and content) of the displayed items does not change.
However the layout does. Sometimes it displays correctly, sometimes it does not (thumbnails overlap). See attached video where I switch back and forth between tabs of the app (not an actual TabView, the tab content is recreated from scratch each time).

The following error/warning shows up in the Xcode console when the thumbnails end up overlapping, but not when the layout works correctly:

Bound preference ElementPreferenceKey tried to update multiple times per frame.

Any idea what is causing this, and how I could fix it?

Btw, as you can see in the video, the layout always animates on initial display. Is that by design? And can that be disabled, ideally without disabling animations during changes?

layout_bug.mov

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions