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

Add beginTime to emitter to fix emitter position #269

Merged
merged 1 commit into from
Feb 25, 2021

Conversation

rcole34
Copy link
Contributor

@rcole34 rcole34 commented Feb 24, 2021

Before you make a Pull Request, read the important guidelines:

Issue Link 🔗

  • Is this a bug fix or a feature? Bug Fix
  • Does it break any existing functionality? No, although it may change some existing functionality (to work how it's supposed to work)

Goals of this PR 🎉

  • Why is the change important? Prevents confetti from appearing in the middle of the screen instead of at the emitter point
  • What does this fix? See videos below (note in the before confetti appears elsewhere on the screen at first instead of just at the emitter point
  • How far has it been tested? Enough to see that it works 🙂 . I came to this solution through the following excerpt from a NSHipster article (https://nshipster.com/caemitterlayer/):

    The central problem is that Core Animation operates on its own timeline, which doesn’t always comport with our own understanding of time.
    For instance, if you neglect to initialize the beginTime of the emitter layer with CACurrentMediaTime() right before it’s displayed, it’ll render with the wrong time space.

Before:
ezgif com-gif-maker (7)

After:
ezgif com-gif-maker (8)

How Has This Been Tested 🔍

Please let us know if you have tested your PR and if we need to reproduce the issues. Also, please let us know if we need any relevant information for running the tests.

  • User Interface Testing
  • Application Testing

Test Configuration 👾

  • Xcode version:
  • Device/Simulator
  • iOS version || MacOSX version

Things to check on 🎯

  • My Pull Request code follows the coding standards and styles of the project
  • I have worked on unit tests and reviewed my code to the best of my ability
  • I have used comments to make other coders understand my code better
  • My changes are good to go without any warnings
  • I have added unit tests both for the happy and sad path
  • All of my unit tests pass successfully before pushing the PR
  • I have made sure all dependent downstream changes impacted by my PR are working

@badrinathvm badrinathvm merged commit 5b543e1 into intuit:master Feb 25, 2021
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.

2 participants