mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
oops, implicit size determination didn't work in embedded mode
This commit is contained in:
parent
a5b78579d0
commit
71bc1c3965
@ -267,14 +267,6 @@ paint_window() {
|
|||||||
// Flip the y axis so that positive Y points down
|
// Flip the y axis so that positive Y points down
|
||||||
CGContextScaleCTM(context, 1.0, -1.0);
|
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.
|
// Clear the whole region to white before beginning.
|
||||||
CGRect region = { { 0, 0 }, { _win_width, _win_height } };
|
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.
|
// If the window changes size, we have to repaint it.
|
||||||
refresh();
|
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
|
// We seem to get the mouse-down, but lose the mouse-up, event
|
||||||
// in this case, so infer it.
|
// in this case, so infer it.
|
||||||
set_mouse_data(_mouse_x, _mouse_y, false);
|
set_mouse_data(_mouse_x, _mouse_y, false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user