Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 24 additions & 23 deletions FPPopoverController.m
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ -(void)presentPopoverFromPoint:(CGPoint)fromPoint

-(CGPoint)originFromView:(UIView*)fromView
{
CGPoint p;
CGPoint p = CGPointZero;
if([_contentView arrowDirection] == FPPopoverArrowDirectionUp ||
[_contentView arrowDirection] == FPPopoverNoArrow)
{
Expand Down Expand Up @@ -311,6 +311,7 @@ -(void)presentPopoverFromView:(UIView*)fromView

-(void)dismissPopover
{
[self.touchView removeFromSuperview];
[self.view removeFromSuperview];
if([self.delegate respondsToSelector:@selector(popoverControllerDidDismissPopover:)])
{
Expand Down Expand Up @@ -365,24 +366,24 @@ -(void)deviceOrientationDidChange:(NSNotification*)notification
if ([_viewController respondsToSelector:@selector(shouldAutorotateToInterfaceOrientation:)] &&
[[[UIDevice currentDevice] systemVersion] floatValue] < 6.0)
{
UIInterfaceOrientation interfaceOrientation;
switch (_deviceOrientation)
{
case UIDeviceOrientationLandscapeLeft:
interfaceOrientation = UIInterfaceOrientationLandscapeLeft;
break;
case UIDeviceOrientationLandscapeRight:
interfaceOrientation = UIInterfaceOrientationLandscapeRight;
break;
case UIDeviceOrientationPortrait:
interfaceOrientation = UIInterfaceOrientationPortrait;
break;
case UIDeviceOrientationPortraitUpsideDown:
interfaceOrientation = UIInterfaceOrientationPortraitUpsideDown;
break;
default:
return; // just ignore face up / face down, etc.
}
// UIInterfaceOrientation interfaceOrientation;
// switch (_deviceOrientation)
// {
// case UIDeviceOrientationLandscapeLeft:
// interfaceOrientation = UIInterfaceOrientationLandscapeLeft;
// break;
// case UIDeviceOrientationLandscapeRight:
// interfaceOrientation = UIInterfaceOrientationLandscapeRight;
// break;
// case UIDeviceOrientationPortrait:
// interfaceOrientation = UIInterfaceOrientationPortrait;
// break;
// case UIDeviceOrientationPortraitUpsideDown:
// interfaceOrientation = UIInterfaceOrientationPortraitUpsideDown;
// break;
// default:
// return; // just ignore face up / face down, etc.
// }
}
else
{
Expand Down Expand Up @@ -424,14 +425,14 @@ -(CGRect)bestArrowDirectionAndFrameFromView:(UIView*)v
// thanks @Niculcea
// If we presentFromPoint with _fromView nil will calculate based on self.orgin with 2x2 size.
// Fix for presentFromPoint from avolovoy's FPPopover fork
float width = 2.0f;
float height = 2.0f;
//float width = 2.0f;
//float height = 2.0f;
CGPoint p = CGPointMake(self.origin.x, self.origin.y);

if (v != nil) {
p = [v.superview convertPoint:v.frame.origin toView:self.view];
width = v.frame.size.width;
height = v.frame.size.height;
//width = v.frame.size.width;
//height = v.frame.size.height;
}


Expand Down