diff --git a/Cocoa/GBView.m b/Cocoa/GBView.m index 103ec78..43a7d11 100644 --- a/Cocoa/GBView.m +++ b/Cocoa/GBView.m @@ -148,6 +148,9 @@ static const uint8_t workboy_vk_to_key[] = { [self observeStandardDefaultsKey:@"GBAspectRatioUnkept" withBlock:^(id newValue) { [weakSelf setFrame:weakSelf.superview.frame]; }]; + [self observeStandardDefaultsKey:@"GBForceIntegerScale" withBlock:^(id newValue) { + [weakSelf setFrame:weakSelf.superview.frame]; + }]; [self observeStandardDefaultsKey:@"JoyKitDefaultControllers" withBlock:^(id newValue) { [weakSelf reassignControllers]; }]; @@ -300,6 +303,19 @@ static const uint8_t workboy_vk_to_key[] = { frame.origin.x = 0; } } + + if (_gb && [[NSUserDefaults standardUserDefaults] boolForKey:@"GBForceIntegerScale"]) { + double factor = self.window.backingScaleFactor; + double width = GB_get_screen_width(_gb) / factor; + double height = GB_get_screen_height(_gb) / factor; + + double new_width = floor(frame.size.width / width) * width; + double new_height = floor(frame.size.height / height) * height; + frame.origin.x += floor((frame.size.width - new_width) / 2); + frame.origin.y += floor((frame.size.height - new_height) / 2); + frame.size.width = new_width; + frame.size.height = new_height; + } [super setFrame:frame]; } diff --git a/Cocoa/Preferences.xib b/Cocoa/Preferences.xib index c5eec87..d75f2ab 100644 --- a/Cocoa/Preferences.xib +++ b/Cocoa/Preferences.xib @@ -1,8 +1,8 @@ - + - + @@ -98,11 +98,11 @@ - + - + @@ -111,7 +111,7 @@ - + @@ -205,7 +205,7 @@ - + @@ -225,7 +225,7 @@ - + @@ -251,7 +251,7 @@ - + @@ -262,7 +262,7 @@ - + @@ -271,7 +271,7 @@ - + @@ -280,7 +280,7 @@ - + @@ -300,7 +300,7 @@ - + @@ -309,7 +309,7 @@ - + @@ -330,7 +330,7 @@ - + @@ -348,7 +348,7 @@ - + @@ -386,7 +386,7 @@ + - + - + @@ -432,7 +444,7 @@ - +