소스 검색

Fix view selection when not in portrait.

Thanks to @lascorbe for discovering this and suggesting a fix (#31).
Ryan Olson 11 년 전
부모
커밋
7a93e9b4dd
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  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];
     }
 }