Assert that the view has a window

This commit is contained in:
Indragie Karunaratne 2013-03-22 18:51:55 -06:00
Родитель 2b96bd2683
Коммит 8c62a35df4
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -11,6 +11,7 @@
@implementation NSView (RBLAlignmentAdditions)
- (NSRect)rbl_viewBackingAlignedRect:(NSRect)rect options:(NSAlignmentOptions)options {
NSAssert(self.window != nil, @"View must have a window in order to obtain a rectangle aligned to the backing.");
NSRect windowRect = [self convertRect:rect toView:nil];
NSRect windowBackingRect = [self backingAlignedRect:windowRect options:options];
return [self convertRect:windowBackingRect fromView:nil];