Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

decelerated pinch zooming on iOS #35

Closed
incanus opened this issue Feb 4, 2014 · 6 comments
Closed

decelerated pinch zooming on iOS #35

incanus opened this issue Feb 4, 2014 · 6 comments
Labels

Comments

@incanus
Copy link
Contributor

incanus commented Feb 4, 2014

Lower priority than #34, but Apple & Google do decelerated zoom coasting upon pinch release. Probably involves manual deceleration easing since UIScrollView doesn't do this.

@kkaefer
Copy link
Member

kkaefer commented Feb 5, 2014

Does the gesture recognizer do this? When I looked at the API, there was something like that in there.

@incanus
Copy link
Contributor Author

incanus commented Feb 5, 2014

No, it does on pan, but not on zoom. There is a bouncing effect on either pan or pinch, but this is just when hitting the limits.

The basic idea of deceleration over in #34 is described here: http://www.odysseyinc.com/blog/rotating-opengl-view-touch-gestures/ The offsets on the scroll view are used to drive a CADisplayLink, which hits the render() call during its own deceleration. I've had good luck with it before e.g. https://dl.dropboxusercontent.com/u/575564/ismapview.mp4 which is a map view I made in raw OpenGL ES which renders raster tiles as textures.

The problem is the zoom pinch gesture does not have any deceleration in UIScrollView.

@incanus
Copy link
Contributor Author

incanus commented Feb 5, 2014

We should use -[UIPinchGestureRecognizer velocity] for this with an easing animation.

@incanus
Copy link
Contributor Author

incanus commented Feb 6, 2014

Making this even lower priority, this sucks hard when you can't cancel other (i.e. pan) animations.

@incanus
Copy link
Contributor Author

incanus commented Feb 7, 2014

Cancel is now in via 28ee596

@incanus incanus closed this as completed in f4edf7a Feb 7, 2014
@incanus
Copy link
Contributor Author

incanus commented Feb 7, 2014

Implememented similarly to decelerated panning. It's hard to trigger since simultaneous pan/rotates can cancel the animation, but it's there in the unlikely event that you merely only pinch. May revisit if this needs tuning up once performance is better.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants