Skip to content

Commit

Permalink
Bring back dem assertions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bigboybad committed Jul 11, 2013
1 parent b70d27f commit f41680b
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lib/UIKit/TUINSView.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@
#import "TUIViewNSViewContainer.h"
#import "TUITooltipWindow.h"

#define LOG_IF_NOT_MAINTHREAD(view) \
if (![NSThread isMainThread]) { \
NSLog(@"%s [Line %d] Called on a background thread for TUINSView %@ with identifier %@", __PRETTY_FUNCTION__, __LINE__, view, view.identifier); \
}

// If enabled, NSViews contained within TUIViewNSViewContainers will be clipped
// by any TwUI ancestors that enable clipping to bounds.
//
Expand Down Expand Up @@ -711,12 +706,13 @@ - (NSView *)hitTest:(NSPoint)point {
}

- (void)recalculateNSViewOrdering; {
LOG_IF_NOT_MAINTHREAD(self);
NSAssert([NSThread isMainThread], @"%s must be called on the main thread.\nTUINSView %@ with identifier %@", __PRETTY_FUNCTION__, self, self.identifier);

[self.appKitHostView sortSubviewsUsingFunction:&compareNSViewOrdering context:NULL];
}

- (void)recalculateNSViewClipping; {
LOG_IF_NOT_MAINTHREAD(self);
NSAssert([NSThread isMainThread], @"%s must be called on the main thread.\nTUINSView %@ with identifier %@", __PRETTY_FUNCTION__, self, self.identifier);

#if !ENABLE_NSVIEW_CLIPPING
return;
Expand Down Expand Up @@ -783,7 +779,7 @@ - (void)recalculateNSViewClipping; {
#pragma mark CALayer delegate

- (void)layoutSublayersOfLayer:(CALayer *)layer {
LOG_IF_NOT_MAINTHREAD(self);
NSAssert([NSThread isMainThread], @"%s must be called on the main thread.\nTUINSView %@ with identifier %@", __PRETTY_FUNCTION__, self, self.identifier);

if (layer == self.layer) {
// TUINSView.layer is being laid out
Expand Down

0 comments on commit f41680b

Please sign in to comment.