From b866b34ac8f341f1d0c5bdaf9f4f36fc5c584a73 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 23 May 2016 21:53:50 +0900 Subject: [PATCH] The unit of position is CGFloat --- atom/browser/api/atom_api_menu_mac.mm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/atom/browser/api/atom_api_menu_mac.mm b/atom/browser/api/atom_api_menu_mac.mm index 70e814a29d70..56a004510554 100644 --- a/atom/browser/api/atom_api_menu_mac.mm +++ b/atom/browser/api/atom_api_menu_mac.mm @@ -51,15 +51,15 @@ void MenuMac::PopupAt(Window* window, int x, int y, int positioning_item) { // If no preferred item is specified, try to show all of the menu items. if (!positioning_item) { - int windowBottom = CGRectGetMinY([view window].frame); - int distaceFromBottom = windowBottom + position.y - [menu size].height; + CGFloat windowBottom = CGRectGetMinY([view window].frame); + CGFloat distaceFromBottom = windowBottom + position.y - [menu size].height; if (distaceFromBottom < 0) position.y = position.y - distaceFromBottom; } // Place the menu left of cursor if it is overflowing off right of screen. - int windowLeft = CGRectGetMinX([view window].frame); - int rightmostPoint = windowLeft + position.x + [menu size].width; + CGFloat windowLeft = CGRectGetMinX([view window].frame); + CGFloat rightmostPoint = windowLeft + position.x + [menu size].width; if (rightmostPoint > [[NSScreen mainScreen] visibleFrame].size.width) position.x = position.x - [menu size].width;