From 71bc1c3965a7f088cea0d2f7f29f2eeede92c688 Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 14 Sep 2009 04:01:28 +0000 Subject: [PATCH] oops, implicit size determination didn't work in embedded mode --- direct/src/plugin/p3dOsxSplashWindow.cxx | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/direct/src/plugin/p3dOsxSplashWindow.cxx b/direct/src/plugin/p3dOsxSplashWindow.cxx index 8e28f4fad1..37ea86846f 100644 --- a/direct/src/plugin/p3dOsxSplashWindow.cxx +++ b/direct/src/plugin/p3dOsxSplashWindow.cxx @@ -267,14 +267,6 @@ paint_window() { // Flip the y axis so that positive Y points down CGContextScaleCTM(context, 1.0, -1.0); - int width = port_rect.right - port_rect.left; - int height = port_rect.bottom - port_rect.top; - if (width != _win_width || height != _win_height) { - _win_width = width; - _win_height = height; - set_button_range(_button_ready_image); - } - // Clear the whole region to white before beginning. CGRect region = { { 0, 0 }, { _win_width, _win_height } }; @@ -550,6 +542,20 @@ event_callback(EventHandlerCallRef my_handler, EventRef event) { // If the window changes size, we have to repaint it. refresh(); + // Also determine the new size. + { + Rect port_rect; + GrafPtr out_port = GetWindowPort(_toplevel_window); + GetPortBounds(out_port, &port_rect); + int width = port_rect.right - port_rect.left; + int height = port_rect.bottom - port_rect.top; + if (width != _win_width || height != _win_height) { + _win_width = width; + _win_height = height; + set_button_range(_button_ready_image); + } + } + // We seem to get the mouse-down, but lose the mouse-up, event // in this case, so infer it. set_mouse_data(_mouse_x, _mouse_y, false);