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 view translate {x,y} for {slide, squeeze} animation #379

Merged
merged 2 commits into from Dec 27, 2016

Conversation

Projects
None yet
4 participants
@tbaranes
Member

tbaranes commented Dec 22, 2016

Since the final x, y were wrong, some animations was failing. In my case, on iPad, since my view was at the bottom of the screen, doing a slide(.out, .down) the view was going out of the screen way too fast (distance = iPad height).

Less talk, more example:

Before the fix, after a slide(.out, .down):

screen shot 2016-12-22 at 09 34 18

With the fix:

screen shot 2016-12-22 at 09 44 57

Tom Baranes added some commits Dec 22, 2016

Tom Baranes
@JakeLin

Cool, let's merge it.

@lastMove

This comment has been minimized.

Show comment
Hide comment
@lastMove

lastMove Dec 26, 2016

Member

Nice One !

Member

lastMove commented Dec 26, 2016

Nice One !

@tbaranes tbaranes merged commit 0d81c6e into master Dec 27, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@tbaranes tbaranes deleted the hotfix/animations branch Dec 27, 2016

@redent

This comment has been minimized.

Show comment
Hide comment
@redent

redent Mar 3, 2017

Contributor

Aren't we adding apple to bananas here? frame is in a different coordinate system than screen size, I'd add this to make it work:

let window = UIApplication.shared.keyWindow!
let screenSize = window.bounds.size
let frame = window.convert(self.frame, from: superview)
Contributor

redent commented on 12d8261 Mar 3, 2017

Aren't we adding apple to bananas here? frame is in a different coordinate system than screen size, I'd add this to make it work:

let window = UIApplication.shared.keyWindow!
let screenSize = window.bounds.size
let frame = window.convert(self.frame, from: superview)

This comment has been minimized.

Show comment
Hide comment
@tbaranes

tbaranes Mar 3, 2017

Member

Can you open an issue explaining what's happening or a PR if you already have a solution?

Member

tbaranes replied Mar 3, 2017

Can you open an issue explaining what's happening or a PR if you already have a solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment