Explorar o código

Fix view selection when not in portrait.

Thanks to @lascorbe for discovering this and suggesting a fix (#31).
Ryan Olson %!s(int64=11) %!d(string=hai) anos
pai
achega
7a93e9b4dd
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      Classes/Explorer Toolbar/FLEXExplorerViewController.m

+ 5 - 1
Classes/Explorer Toolbar/FLEXExplorerViewController.m

@@ -594,7 +594,11 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
 {
     // Only if we're in selection mode
     if (self.currentMode == FLEXExplorerModeSelect && tapGR.state == UIGestureRecognizerStateRecognized) {
-        [self updateOutlineViewsForSelectionPoint:[tapGR locationInView:nil]];
+        // Note that [tapGR locationInView:nil] is broken in iOS 8, so we have to do a two step conversion to window coordinates.
+        // Thanks to @lascorbe for finding this: https://github.com/Flipboard/FLEX/pull/31
+        CGPoint tapPointInView = [tapGR locationInView:self.view];
+        CGPoint tapPointInWindow = [self.view convertPoint:tapPointInView toView:nil];
+        [self updateOutlineViewsForSelectionPoint:tapPointInWindow];
     }
 }