mirror of
https://github.com/SFML/SFML.git
synced 2024-11-28 22:31:09 +08:00
Added sending a resize event when the scaling factor changes on OS X
This commit is contained in:
parent
66f38262f7
commit
9b0ce8888e
@ -266,7 +266,14 @@ BOOL isValidTextUnicode(NSEvent* event);
|
||||
{
|
||||
NSWindow* window = [self window];
|
||||
NSScreen* screen = window ? [window screen] : [NSScreen mainScreen];
|
||||
CGFloat oldScaleFactor = m_scaleFactor;
|
||||
m_scaleFactor = [screen backingScaleFactor];
|
||||
|
||||
// Send a resize event if the scaling factor changed
|
||||
if ((m_scaleFactor != oldScaleFactor) && (m_requester != 0)) {
|
||||
NSSize newSize = [self frame].size;
|
||||
m_requester->windowResized(newSize.width, newSize.height);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user