mirror of
https://github.com/zydeco/minivmac4ios.git
synced 2024-06-01 10:41:33 +00:00
use nearest neighbour interpolation if scale is integer
This commit is contained in:
parent
6d5d57787b
commit
97ab910a84
|
@ -56,6 +56,10 @@ static ScreenView *sharedScreenView = nil;
|
||||||
screenBounds.origin.x = (viewBounds.size.width - screenBounds.size.width)/2;
|
screenBounds.origin.x = (viewBounds.size.width - screenBounds.size.width)/2;
|
||||||
screenBounds = CGRectIntegral(screenBounds);
|
screenBounds = CGRectIntegral(screenBounds);
|
||||||
videoLayer.frame = screenBounds;
|
videoLayer.frame = screenBounds;
|
||||||
|
BOOL scaleIsIntegral = (floor(screenScale) == screenScale);
|
||||||
|
NSString *screenFilter = scaleIsIntegral ? kCAFilterNearest : [[NSUserDefaults standardUserDefaults] stringForKey:@"screenFilter"];
|
||||||
|
videoLayer.magnificationFilter = screenFilter;
|
||||||
|
videoLayer.minificationFilter = screenFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context {
|
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user