Guest User

Untitled

a guest
May 19th, 2012
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. CALayer Live Resize Poor Performance
  2. -(void)setFrameSize:(NSSize)newSize
  3. {
  4. if (inLiveResize) {
  5. NSRect scrollFrame = [[[self superview] enclosingScrollView] documentVisibleRect];
  6.  
  7. BOOL condition1 = (self.frame.origin.y > (scrollFrame.origin.y - self.frame.size.height));
  8. BOOL condition2 = (self.frame.origin.y < (scrollFrame.origin.y + scrollFrame.size.height + self.frame.size.height));
  9.  
  10. if (condition1 && condition2)
  11. [super setFrameSize:newSize];
  12. }
  13. else {
  14. [super setFrameSize:newSize]; }}
Advertisement
Add Comment
Please, Sign In to add comment