mirror of
https://github.com/italicsjenga/rust_minifb.git
synced 2025-01-11 03:21:32 +11:00
Fixed crash on Mac for large Windows
In some cases a resize event can happen before we have setup our user-data. Now we make sure that user data is present before using it Closes #26
This commit is contained in:
parent
31215a5b21
commit
26d41d1d07
|
@ -128,8 +128,11 @@
|
||||||
{
|
{
|
||||||
NSSize size = [self bounds].size;
|
NSSize size = [self bounds].size;
|
||||||
OSXWindow* window = (OSXWindow*)[self window];
|
OSXWindow* window = (OSXWindow*)[self window];
|
||||||
|
|
||||||
|
if (window->shared_data) {
|
||||||
window->shared_data->width = (int)(size.width);
|
window->shared_data->width = (int)(size.width);
|
||||||
window->shared_data->height = (int)(size.height);
|
window->shared_data->height = (int)(size.height);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Reference in a new issue