Improved picture zooming and rotating on touch devices #1268

Merged
merged 12 commits into from Sep 3, 2012

Conversation

Projects
None yet
2 participants
@Montellese
Member

Montellese commented Aug 9, 2012

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.

@ghost ghost assigned Montellese Aug 9, 2012

@Memphiz

This comment has been minimized.

Show comment
Hide comment
@Memphiz

Memphiz Aug 9, 2012

Member

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

Member

Memphiz commented Aug 9, 2012

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

Montellese added some commits Aug 2, 2012

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.
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.

Montellese added a commit that referenced this pull request Sep 3, 2012

Merge pull request #1268 from Montellese/picture_zoom_rotate
Improved picture zooming and rotating on touch devices

@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