mirror of
https://github.com/nickshanks/ResKnife.git
synced 2024-07-10 01:28:55 +00:00
22 lines
600 B
Objective-C
22 lines
600 B
Objective-C
//
|
|
// RKPatternImageCell.m
|
|
// ResKnife
|
|
//
|
|
// Created by Nate Weaver on 2012-7-8.
|
|
// Copyright (c) 2012 Derailer. All rights reserved.
|
|
//
|
|
|
|
#import "RKPatternImageCell.h"
|
|
|
|
@implementation RKPatternImageCell
|
|
|
|
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
|
|
NSColor *pattern = [NSColor colorWithPatternImage:[self image]];
|
|
NSPoint phasePoint = [controlView convertPoint:(NSPoint){ .x = 0.0, .y = cellFrame.origin.y } toView:nil];
|
|
[[NSGraphicsContext currentContext] setPatternPhase:phasePoint];
|
|
[pattern set];
|
|
NSRectFill(NSInsetRect(cellFrame, 1.0, 1.0));
|
|
}
|
|
|
|
@end
|