ios/iosremote/iosremote.xcodeproj/project.xcworkspace/xcuserdata/siqi.xcuserdatad/UserInterfaceState.xcuserstate
 |binary
 ios/iosremote/iosremote/slideShow_vc.m                                         
                                  |  110 +++++-----
 2 files changed, 57 insertions(+), 53 deletions(-)

New commits:
commit 08225e92133bd056bd18d404da5655df14831b36
Author: siqi <m...@siqi.fr>
Date:   Fri Jul 12 16:25:57 2013 +0200

    disable pointer when enlarged image is hidden
    
    Change-Id: I6c637a4d8d8e0e3ffdeeb29ea98ca184d198355e

diff --git 
a/ios/iosremote/iosremote.xcodeproj/project.xcworkspace/xcuserdata/siqi.xcuserdatad/UserInterfaceState.xcuserstate
 
b/ios/iosremote/iosremote.xcodeproj/project.xcworkspace/xcuserdata/siqi.xcuserdatad/UserInterfaceState.xcuserstate
index ea2ca0d..baead88 100644
Binary files 
a/ios/iosremote/iosremote.xcodeproj/project.xcworkspace/xcuserdata/siqi.xcuserdatad/UserInterfaceState.xcuserstate
 and 
b/ios/iosremote/iosremote.xcodeproj/project.xcworkspace/xcuserdata/siqi.xcuserdatad/UserInterfaceState.xcuserstate
 differ
diff --git a/ios/iosremote/iosremote/slideShow_vc.m 
b/ios/iosremote/iosremote/slideShow_vc.m
index db979a3..eca3531 100644
--- a/ios/iosremote/iosremote/slideShow_vc.m
+++ b/ios/iosremote/iosremote/slideShow_vc.m
@@ -65,9 +65,9 @@
 
 - (void)startMotionDetect
 {
-//    __block float stepMoveFactorX = 5;
-//    __block float stepMoveFactorY = 5;
-//    __block double refX, refY;
+    //    __block float stepMoveFactorX = 5;
+    //    __block float stepMoveFactorY = 5;
+    //    __block double refX, refY;
 
     [self.motionManager
      startAccelerometerUpdatesToQueue:[[NSOperationQueue alloc] init]
@@ -76,38 +76,38 @@
 
          dispatch_async(dispatch_get_main_queue(),
                         ^{
-                                CGRect rect = self.movingPointer.frame;
-                                NSLog(@"x:%f y:%f z:%f", data.acceleration.x, 
data.acceleration.y, data.acceleration.z);
-                                // Used to calibrate pointer based on initial 
position
-                                //                            if 
(self.pointerCalibrationOn){
-                                //                                refX = 
data.acceleration.x;
-                                //                                refY = 
data.acceleration.y;
-                                //                                
self.pointerCalibrationOn = NO;
-                                //                            }
-//                                float movetoX = rect.origin.x + 
((data.acceleration.x - refX) * stepMoveFactorX);
-
-                                float movetoX = 
self.touchPointerImage.frame.origin.x + self.touchPointerImage.frame.size.width 
* ABS(data.acceleration.x - self.refLeftUpperGravity.x) / 
ABS(self.refRightUpperGravity.x - self.refLeftUpperGravity.x);
-                                float maxX = 
self.touchPointerImage.frame.origin.x + self.touchPointerImage.frame.size.width 
- rect.size.width;
-
-//                                float movetoY = (rect.origin.y) + 
((data.acceleration.y - refY) * stepMoveFactorY);
-                                float movetoY = 
self.touchPointerImage.frame.origin.y + 
self.touchPointerImage.frame.size.height * ABS(data.acceleration.y - 
self.refRightUpperGravity.y) / ABS(self.refRightLowerGravity.y - 
self.refRightUpperGravity.y);
-                                float maxY = 
self.touchPointerImage.frame.origin.y + 
self.touchPointerImage.frame.size.height;
-
-                                if ( movetoX > 
self.touchPointerImage.frame.origin.x && movetoX < maxX ) {
-                                    rect.origin.x = movetoX;
-                                };
-
-                                if ( movetoY > 
self.touchPointerImage.frame.origin.y && movetoY < maxY ) {
-                                    rect.origin.y = movetoY;
-                                };
-
-                                [UIView animateWithDuration:0 delay:0
-                                                    
options:UIViewAnimationOptionCurveEaseIn
-                                                 animations:^{
-                                     self.movingPointer.frame = rect;
-                                 }
-                                                 completion:nil
-                                 ];
+                            CGRect rect = self.movingPointer.frame;
+                            NSLog(@"x:%f y:%f z:%f", data.acceleration.x, 
data.acceleration.y, data.acceleration.z);
+                            // Used to calibrate pointer based on initial 
position
+                            //                            if 
(self.pointerCalibrationOn){
+                            //                                refX = 
data.acceleration.x;
+                            //                                refY = 
data.acceleration.y;
+                            //                                
self.pointerCalibrationOn = NO;
+                            //                            }
+                            //                                float movetoX = 
rect.origin.x + ((data.acceleration.x - refX) * stepMoveFactorX);
+
+                            float movetoX = 
self.touchPointerImage.frame.origin.x + self.touchPointerImage.frame.size.width 
* ABS(data.acceleration.x - self.refLeftUpperGravity.x) / 
ABS(self.refRightUpperGravity.x - self.refLeftUpperGravity.x);
+                            float maxX = self.touchPointerImage.frame.origin.x 
+ self.touchPointerImage.frame.size.width - rect.size.width;
+
+                            //                                float movetoY = 
(rect.origin.y) + ((data.acceleration.y - refY) * stepMoveFactorY);
+                            float movetoY = 
self.touchPointerImage.frame.origin.y + 
self.touchPointerImage.frame.size.height * ABS(data.acceleration.y - 
self.refRightUpperGravity.y) / ABS(self.refRightLowerGravity.y - 
self.refRightUpperGravity.y);
+                            float maxY = self.touchPointerImage.frame.origin.y 
+ self.touchPointerImage.frame.size.height;
+
+                            if ( movetoX > 
self.touchPointerImage.frame.origin.x && movetoX < maxX ) {
+                                rect.origin.x = movetoX;
+                            };
+
+                            if ( movetoY > 
self.touchPointerImage.frame.origin.y && movetoY < maxY ) {
+                                rect.origin.y = movetoY;
+                            };
+
+                            [UIView animateWithDuration:0 delay:0
+                                                
options:UIViewAnimationOptionCurveEaseIn
+                                             animations:^{
+                                                 self.movingPointer.frame = 
rect;
+                                             }
+                                             completion:nil
+                             ];
                         });
      }];
 }
@@ -186,29 +186,33 @@
 }
 
 - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
-    UITouch *touch = [[event allTouches] anyObject];
-    CGPoint loc = [touch locationInView:self.touchPointerImage];
-    if (loc.x >= 0 && loc.x <= self.touchPointerImage.frame.size.width
-        && loc.y >= 0 && loc.y <= self.touchPointerImage.frame.size.height){
-        CGPoint p;
-        p.x = loc.x + self.touchPointerImage.frame.origin.x;
-        p.y = loc.y + self.touchPointerImage.frame.origin.y;
-        self.movingPointer.center = p;
-        [self.movingPointer setHidden:NO];
+    if (!self.touchPointerImage.isHidden){
+        UITouch *touch = [[event allTouches] anyObject];
+        CGPoint loc = [touch locationInView:self.touchPointerImage];
+        if (loc.x >= 0 && loc.x <= self.touchPointerImage.frame.size.width
+            && loc.y >= 0 && loc.y <= 
self.touchPointerImage.frame.size.height){
+            CGPoint p;
+            p.x = loc.x + self.touchPointerImage.frame.origin.x;
+            p.y = loc.y + self.touchPointerImage.frame.origin.y;
+            self.movingPointer.center = p;
+            [self.movingPointer setHidden:NO];
+        }
     }
 }
 
 - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
 {
-    UITouch *touch = [[event allTouches] anyObject];
-    CGPoint loc = [touch locationInView:self.touchPointerImage];
-    if (loc.x >= 0 && loc.x <= self.touchPointerImage.frame.size.width
-        && loc.y >= self.movingPointer.frame.size.height && loc.y <= 
self.touchPointerImage.frame.size.height - self.movingPointer.frame.size.height)
-    {
-        CGPoint p;
-        p.x = loc.x + self.touchPointerImage.frame.origin.x;
-        p.y = loc.y + self.touchPointerImage.frame.origin.y;
-        self.movingPointer.center = p;
+    if (!self.touchPointerImage.isHidden){
+        UITouch *touch = [[event allTouches] anyObject];
+        CGPoint loc = [touch locationInView:self.touchPointerImage];
+        if (loc.x >= 0 && loc.x <= self.touchPointerImage.frame.size.width
+            && loc.y >= self.movingPointer.frame.size.height && loc.y <= 
self.touchPointerImage.frame.size.height - self.movingPointer.frame.size.height)
+        {
+            CGPoint p;
+            p.x = loc.x + self.touchPointerImage.frame.origin.x;
+            p.y = loc.y + self.touchPointerImage.frame.origin.y;
+            self.movingPointer.center = p;
+        }
     }
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to