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

[ASStackLayoutSpec] Fix interitem spacing not being reset on new lines and add snapshot tests #trivial #491

Merged
merged 3 commits into from
Aug 6, 2017

Conversation

nguyenhuy
Copy link
Member

Follow up on #472. Closes #489.

@ghost
Copy link

ghost commented Aug 3, 2017

🚫 CI failed with log

@ghost
Copy link

ghost commented Aug 3, 2017

🚫 CI failed with log

@flovouin
Copy link
Contributor

flovouin commented Aug 4, 2017

Oh wow, thanks for this @nguyenhuy, I didn't know you would get on this so quickly.
Sorry for the extra work I put on you!

@nguyenhuy
Copy link
Member Author

@flovouin No worries at all! I'm working on improving ASCollectionGalleryLayoutDelegate which requires line spacing and figured it's best to have tests now.

And I found a bug :) Please see the fix included in this PR here. The problem is that for the last item that can't fit into an existing line, we include interitem spacing into its stack dimension sum and carry that onto a new line. It then causes another item, which otherwise should be the last item of that line, to be pushed to yet another line (see screenshots below). Fix by resetting interitem spacing when we break to a new line.

Before:
testflexwrapwithitemspacingsbeingresetonnewlines 2x

After:
testflexwrapwithitemspacingsbeingresetonnewlines 2x

@nguyenhuy nguyenhuy changed the title [ASStackLayoutSpec] Add snapshot tests for interitem and interline spacings #trivial [ASStackLayoutSpec] Fix interitem spacing not being reset on new lines and add snapshot tests #trivial Aug 4, 2017
@flovouin
Copy link
Contributor

flovouin commented Aug 4, 2017

Oh I see, nice catch! That was a stupid mistake on my side, sorry about that. :/
Thanks again!

@ghost
Copy link

ghost commented Aug 4, 2017

🚫 CI failed with log

@nguyenhuy
Copy link
Member Author

I didn't catch it during code review, so it's my fault as well :P

Copy link
Contributor

@maicki maicki left a comment

Choose a reason for hiding this comment

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

Really awesome work from @flovouin and @nguyenhuy on all of that!

@nguyenhuy
Copy link
Member Author

Thanks, @maicki.

@nguyenhuy nguyenhuy merged commit 69a9153 into TextureGroup:master Aug 6, 2017
@nguyenhuy nguyenhuy deleted the HNLineSpacingTests branch August 6, 2017 12:22
bernieperez pushed a commit to AtomTickets/Texture that referenced this pull request Apr 25, 2018
…s and add snapshot tests #trivial (TextureGroup#491)

* Add snapshot tests for interitem and interline spacings of stack spec

* Improve comment

* Make sure item spacings are properly considered and reset on new lines, snapshot tests included
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.

3 participants