Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. - (void)drawRect:(NSRect)dirtyRect
  2. {
  3. NSGraphicsContext *ctx = [NSGraphicsContext currentContext];
  4. [ctx saveGraphicsState];
  5.  
  6. NSBezierPath *clipPath = [NSBezierPath bezierPathWithRoundedRect:[self bounds] xRadius:5.0 yRadius:5.0];
  7. [clipPath addClip];
  8.  
  9. NSDrawNinePartImage([self bounds], topLeft, topCenter, topRight, middleLeft, middleCenter, middleRight, bottomLeft, bottomCenter, bottomRight, NSCompositeSourceOver, 1.0, NO);
  10.  
  11. [ctx restoreGraphicsState];
  12.  
  13. [super drawRect:dirtyRect];
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement