mirror of
https://github.com/italicsjenga/rust_minifb.git
synced 2024-12-23 11:21:30 +11:00
Fix get_window_position for multiscreen setups on macOS. (#299)
This commit is contained in:
parent
3da7b7b22e
commit
193726cd6d
|
@ -567,8 +567,9 @@ void mfb_get_position(const void* window, int *px, int *py)
|
||||||
*px = rectW.origin.x;
|
*px = rectW.origin.x;
|
||||||
}
|
}
|
||||||
if( py != NULL ) {
|
if( py != NULL ) {
|
||||||
const NSRect msf = [[NSScreen mainScreen] frame];
|
const NSScreen *screen = [win screen];
|
||||||
const float height = msf.size.height;
|
const NSRect wsf = [screen frame];
|
||||||
|
const float height = wsf.size.height;
|
||||||
const float h = rectW.size.height;
|
const float h = rectW.size.height;
|
||||||
*py = height - ( rectW.origin.y + h ); // origin is from bottom
|
*py = height - ( rectW.origin.y + h ); // origin is from bottom
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue