Skip to content
Browse files

[ios] adapt ios touch events for the new pinch strategy (thanks Memphiz)

  • Loading branch information...
1 parent 666e54d commit 76f8c0c923cc80666152122394f33a953e77568b @Montellese committed Aug 2, 2012
Showing with 9 additions and 15 deletions.
  1. +0 −4 xbmc/osx/ios/XBMCController.h
  2. +9 −11 xbmc/osx/ios/XBMCController.mm
View
4 xbmc/osx/ios/XBMCController.h
@@ -38,8 +38,6 @@
/* Touch handling */
CGSize screensize;
CGPoint lastGesturePoint;
- CGFloat lastPinchScale;
- CGFloat currentPinchScale;
CGFloat screenScale;
bool touchBeginSignaled;
int m_screenIdx;
@@ -50,8 +48,6 @@
}
@property (readonly, nonatomic, getter=isAnimating) BOOL animating;
@property CGPoint lastGesturePoint;
-@property CGFloat lastPinchScale;
-@property CGFloat currentPinchScale;
@property CGFloat screenScale;
@property bool touchBeginSignaled;
@property int m_screenIdx;
View
20 xbmc/osx/ios/XBMCController.mm
@@ -68,8 +68,6 @@ -(void) terminateWithSuccess;
@implementation XBMCController
@synthesize animating;
@synthesize lastGesturePoint;
-@synthesize lastPinchScale;
-@synthesize currentPinchScale;
@synthesize screenScale;
@synthesize lastEvent;
@synthesize touchBeginSignaled;
@@ -193,8 +191,6 @@ - (void)createGestureRecognizers
pinch.delaysTouchesBegan = YES;
[self.view addGestureRecognizer:pinch];
[pinch release];
- lastPinchScale = 1.0;
- currentPinchScale = lastPinchScale;
}
//--------------------------------------------------------------
- (void) activateKeyboard:(UIView *)view
@@ -214,21 +210,23 @@ -(void)handlePinch:(UIPinchGestureRecognizer*)sender
CGPoint point = [sender locationOfTouch:0 inView:m_glView];
point.x *= screenScale;
point.y *= screenScale;
- currentPinchScale += [sender scale] - lastPinchScale;
- lastPinchScale = [sender scale];
switch(sender.state)
{
case UIGestureRecognizerStateBegan:
- break;
+ CApplicationMessenger::Get().SendAction(CAction(ACTION_GESTURE_BEGIN, 0, (float)point.x, (float)point.y,
+ 0, 0), WINDOW_INVALID,false);
+ break;
case UIGestureRecognizerStateChanged:
CApplicationMessenger::Get().SendAction(CAction(ACTION_GESTURE_ZOOM, 0, (float)point.x, (float)point.y,
- currentPinchScale, 0), WINDOW_INVALID,false);
- break;
+ [sender scale], 0), WINDOW_INVALID,false);
+ break;
case UIGestureRecognizerStateEnded:
- break;
+ CApplicationMessenger::Get().SendAction(CAction(ACTION_GESTURE_END, 0, 0, 0,
+ 0, 0), WINDOW_INVALID,false);
+ break;
default:
- break;
+ break;
}
}
}

0 comments on commit 76f8c0c

Please sign in to comment.
Something went wrong with that request. Please try again.