Improved picture zooming and rotating on touch devices #1268

Merged
merged 12 commits into from Sep 3, 2012

Projects

None yet

2 participants

@Montellese
Member

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.

@Montellese Montellese was assigned Aug 9, 2012
@Memphiz
Member
Memphiz commented Aug 9, 2012

Still works really nice :) - signed-off for ios...

Montellese added some commits Aug 2, 2012
@Montellese Montellese cosmetics in CGUIWindowSlideShow b05249a
@Montellese Montellese CGUIWindowSlideShow: unload and close both pre-loaded images 224e20e
@Montellese Montellese [droid] send ACTION_GESTURE_BEGIN and ACTION_GESTURE_END on multi-tou…
…ch start and end
d377358
@Montellese Montellese refactor picture zooming
The new implementation supports both zooming by fixed levels (used for remote
controls) and zooming by an arbitrary factor which makes zooming/pinching
with touch gestures much more intuitive. Nothing changes for zooming by fixed
levels but for zooming by an arbitrary factor every zoom/pinch 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 can be sent containing an arbitrary floating-point zoom
factor to perform zoom/pinch actions.
666e54d
@Montellese Montellese refactor picture rotating
The new implementation supports both rotating by fixed angles of +90 degree
(used for remote controls) and rotating by an arbitrary angle which makes
rotating with touch gestures much more intuitive. Nothing changes for zooming
by fixed angles. For rotating by an arbitrary factor every rotation must start
by sending the ACTION_GESTURE_BEGIN action and end by sending the
ACTION_GESTURE_END action. In between the ACTION_GESTURE_ROTATE can be sent
containing an arbitrary floating-point angle (in degrees) to perform rotation
actions.
b6f611d
@Montellese Montellese CGUIWindowSlideShow: allow rotating while being zoomed e7f9217
@Montellese Montellese [ios] adapt ios touch events for the new pinch strategy (thanks Memphiz) 76f8c0c
@Montellese Montellese CGUIWindowSlideShow: snap back to a multiple of 90 degrees if the rot…
…ation angle is within +/- 10 degrees
c25b084
@Montellese Montellese CTouchInput: add two-finger rotation detection and ITouchHandler::OnR…
…otate
8dd9530
@Montellese Montellese [droid] CAndroidTouch: implement OnRotate by sending ACTION_GESTURE_R…
…OTATE
2a0904c
@Montellese Montellese [ios] implement rotation gesture support (thanks Memphiz) cd4ff8f
@Montellese Montellese add rotateccw action and a new optional parameter value to Player.Rot…
…ate in JSON-RPC
f5cf334
@Montellese Montellese merged commit e13dcf3 into xbmc:master Sep 3, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment