Move the menu sightly higher when repositioning the menu

Otherwise the menu is not able to show the last menu item and the arrow
will show.
This commit is contained in:
Cheng Zhao 2016-05-23 21:54:06 +09:00
parent b866b34ac8
commit 0d4f1abdf9

View file

@ -54,7 +54,7 @@ void MenuMac::PopupAt(Window* window, int x, int y, int positioning_item) {
CGFloat windowBottom = CGRectGetMinY([view window].frame);
CGFloat distaceFromBottom = windowBottom + position.y - [menu size].height;
if (distaceFromBottom < 0)
position.y = position.y - distaceFromBottom;
position.y = position.y - distaceFromBottom + 4;
}
// Place the menu left of cursor if it is overflowing off right of screen.