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

[ASImageNode+AnimatedImage] Fix early return when animatedImage is nil in setAnimatedImage #trivial #925

Merged
merged 2 commits into from
May 21, 2018
Merged

Conversation

flovouin
Copy link
Contributor

Hey guys,

I recently tried to update to master and ran into an issue where the defaultImages I set in my ASNetworkImageNode are replaced by nil when they leave the preload range.
It turns out, #896 does not take into account the case where the animatedImage might be nil. Hence the call to _locked_setAnimatedImage no longer performs an early return like it used to, because animatedImage.playbackReady is NO.
This PR fixes this and gives me back my defaultImages, even after they've gone out of the preload range and back. :-D

This time I haven't set up a sample project like I usually do, but I made up for it by adding a new test, yay! This test shows that the defaultImage is currently incorrectly set to nil when the ASNetworkImageNode leaves the preload range.
I've also slightly improved the (very similar) existing test for the image property, because didExitPreloadState wasn't actually called (see the diff and the related comment).

Please tell me how this looks and if I can improve anything!

Cheers,

Flo

@ghost
Copy link

ghost commented May 18, 2018

1 Warning
⚠️ Any source code changes should have an entry in CHANGELOG.md or have #trivial in their title.

Generated by 🚫 Danger

@flovouin flovouin changed the title [ASImageNode+AnimatedImage] Fix early return when animatedImage is nil in setAnimatedImage [ASImageNode+AnimatedImage] Fix early return when animatedImage is nil in setAnimatedImage #trivial May 18, 2018
Copy link
Member

@Adlai-Holler Adlai-Holler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome diff as always @flovouin!

@Adlai-Holler Adlai-Holler merged commit ede9a7f into TextureGroup:master May 21, 2018
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.

None yet

2 participants