зеркало из https://github.com/github/Rebel.git
Minor style fixes
This commit is contained in:
Родитель
2062ad4bd2
Коммит
cf5062c7f4
|
@ -11,14 +11,16 @@
|
|||
@implementation NSView (RBLAlignmentAdditions)
|
||||
|
||||
- (NSRect)rbl_viewBackingAlignedRect:(NSRect)rect options:(NSAlignmentOptions)options {
|
||||
if (self.window) {
|
||||
if (self.window != nil) {
|
||||
NSRect windowRect = [self convertRect:rect toView:nil];
|
||||
NSRect windowBackingRect = [self backingAlignedRect:windowRect options:options];
|
||||
return [self convertRect:windowBackingRect fromView:nil];
|
||||
} else {
|
||||
CGFloat scaleFactor = [[NSScreen mainScreen] backingScaleFactor];
|
||||
// Use a best guess for how to align to the backing store.
|
||||
CGFloat scaleFactor = NSScreen.mainScreen.backingScaleFactor;
|
||||
CGAffineTransform transformToBacking = CGAffineTransformMakeScale(scaleFactor, scaleFactor);
|
||||
CGRect backingRect = CGRectApplyAffineTransform(rect, transformToBacking);
|
||||
|
||||
CGRect backingRect = CGRectApplyAffineTransform(rect, transformToBacking);
|
||||
backingRect = NSIntegralRectWithOptions(backingRect, options);
|
||||
return CGRectApplyAffineTransform(backingRect, CGAffineTransformInvert(transformToBacking));
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче