From a50d2035a72e1b90ecd267b17a9809a10e5cbeae Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 13 Nov 2014 22:15:32 +0000 Subject: Fix cocoa usage of render internals --- cocoa/FormSelectMenu.m | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'cocoa/FormSelectMenu.m') diff --git a/cocoa/FormSelectMenu.m b/cocoa/FormSelectMenu.m index 842d5108d..27156bcae 100644 --- a/cocoa/FormSelectMenu.m +++ b/cocoa/FormSelectMenu.m @@ -22,6 +22,13 @@ #import "desktop/browser.h" #import "render/form.h" +static inline NSRect cocoa_rect_for_control( struct browser_window *bw, struct form_control *control) +{ + struct rect r; + form_control_bounding_rect(control, &r); + return cocoa_scaled_rect(browser_window_get_scale(bw), r.x0, r.y0, r.x1, r.y1 ); +} + @interface FormSelectMenu () - (void) itemSelected: (id) sender; @@ -79,8 +86,8 @@ cell = [[NSPopUpButtonCell alloc] initTextCell: @"" pullsDown: YES]; [cell setMenu: menu]; - - const NSRect rect = cocoa_rect_for_box( browser, control->box ); + + const NSRect rect = cocoa_rect_for_control(browser, control); [cell attachPopUpWithFrame: rect inView: view]; [cell performClickWithFrame: rect inView: view]; -- cgit v1.2.3