Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CoilImage not refreshing if data changes #35

Merged
merged 2 commits into from Jul 7, 2020
Merged

Conversation

chrisbanes
Copy link
Contributor

@chrisbanes chrisbanes commented Jul 7, 2020

We were using a state for storing the previous load result, which meant that we would use the same result, regardless of whether the data/request changes. Fixed by using stateFor(data) instead.

While writing the test, I also found that loading drawables with no intrinsic size (<shape>s, etc) would crash while being drawn to a bitmap (because they have 0px intrinsic width/height). Fixed by passing through the request size as a fallback.

We were using a `state` for storing any previous results, which
meant that we would use the same result, regardless of whether the
data/request changes. Fixed by using `stateFor(data)` instead.

While writing the test, I also found that loading drawables with no
intrinsic size (`<shape>`s, etc) would crash while being drawn to
a bitmap. Fixed by passing through the request size as a fallback.
@chrisbanes chrisbanes merged commit 7e8397d into main Jul 7, 2020
@chrisbanes chrisbanes deleted the cb/data-changes branch July 7, 2020 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants