Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Improved picture zooming and rotating on touch devices #1268
This PR contains better implementations for zooming/pinching and rotating images in CGUIWindowSlideShow when used with touch devices (and a few cosmetics).
This new implementation supports both the existing zooming/rotating by fixed levels (used for remote controls) and zooming/rotating by an arbitrary factor/angle which makes zooming/pinching/rotating with touch gestures much more intuitive. Nothing changes for zooming/rotating by fixed levels but for zooming/rotating by an arbitrary factor every zoom/pinch/rotation must start by sending the ACTION_GESTURE_BEGIN action and end by sending the ACTION_GESTURE_END action. In between (as it was already possible before, the ACTION_GESTURE_ZOOM/ACTION_GESTURE_ROTATE can be sent containing an arbitrary floating-point zoom factor/angle to perform zoom/pinch/rotation actions.
This PR only changes both implementation for Android and for iOS (thanks @Memphiz) but might need work on other touch input implementations but it's a lot more intuitive with this than it currently is. Currently touch based zooming/pinching is useless expect when zooming into an unzoomed image. Once the image has been zoomed any zoom/pinch action will result in unexpected behaviour. Rotation was not implemented at all because currently it is only possible to rotate in steps of 90 degrees clockwise and nothing else.
This implementation does not (yet) consider the center point of the zooming/pinching action. It will simply zoom with the center being the center of the currently visible part of the image.