Skip to content

Commit

Permalink
Fixed arrow direction calculation.
Browse files Browse the repository at this point in the history
Was missing break statement. Now using visible screen frame (not including menu bar and dock).
  • Loading branch information
triplef committed Oct 21, 2011
1 parent 70823d4 commit daf77df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion INPopoverController.m
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ - (void)_setInitialPropertyValues
// Figure out which direction best stays in screen bounds
- (INPopoverArrowDirection)_arrowDirectionWithPreferredArrowDirection:(INPopoverArrowDirection)direction
{
NSRect screenFrame = [[[_positionView window] screen] frame];
NSRect screenFrame = [[[_positionView window] screen] visibleFrame];
// If the window with the preferred arrow direction already falls within the screen bounds then no need to go any further
NSRect windowFrame = [self popoverFrameWithSize:self.contentSize andArrowDirection:direction];
if (NSContainsRect(screenFrame, windowFrame)) {
Expand Down Expand Up @@ -336,6 +336,7 @@ - (INPopoverArrowDirection)_arrowDirectionWithPreferredArrowDirection:(INPopover
case INPopoverArrowDirectionUp:
case INPopoverArrowDirectionDown:
newDirection = arrowLeft ? INPopoverArrowDirectionLeft : INPopoverArrowDirectionRight;
break;
case INPopoverArrowDirectionLeft:
case INPopoverArrowDirectionRight:
newDirection = arrowUp ? INPopoverArrowDirectionUp : INPopoverArrowDirectionDown;
Expand Down

0 comments on commit daf77df

Please sign in to comment.