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 +++++++++-- cocoa/coordinates.h | 7 ------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'cocoa') 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]; diff --git a/cocoa/coordinates.h b/cocoa/coordinates.h index d5504941a..a43db0b65 100644 --- a/cocoa/coordinates.h +++ b/cocoa/coordinates.h @@ -21,7 +21,6 @@ #include "utils/utils.h" #import "desktop/browser.h" -#import "render/box.h" extern CGFloat cocoa_scale_factor; @@ -105,11 +104,5 @@ static inline NSRect cocoa_scaled_rect( CGFloat scale, int x0, int y0, int x1, i return cocoa_scaled_rect_wh( scale, x0, y0, x1 - x0, y1 - y0 ); } -static inline NSRect cocoa_rect_for_box( struct browser_window *bw, struct box *box ) -{ - struct rect r; - box_bounds( box, &r ); - return cocoa_scaled_rect(browser_window_get_scale(bw), r.x0, r.y0, r.x1, r.y1 ); -} #endif -- cgit v1.2.3