Merge pull request #43 from github/clipsToBounds

Add RBLView clipsToBounds property
This commit is contained in:
Justin Spahr-Summers 2012-10-26 13:30:35 -07:00
Родитель 65cdfe4454 a20e6ed642
Коммит 2763201ad1
2 изменённых файлов: 18 добавлений и 2 удалений

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

@ -15,16 +15,24 @@
// The backing layer's background color, or nil if none has been set.
@property (nonatomic, strong) NSColor *backgroundColor;
// Whether the view's content and subviews clip to its bounds.
//
// Setting this property is equivalent to setting maskToBounds on the backing
// layer.
//
// Defaults to NO.
@property (nonatomic, assign) BOOL clipsToBounds;
// Whether the view's drawing completely fills its bounds with opaque content.
//
// Defaults to NO.
@property (nonatomic, getter = isOpaque) BOOL opaque;
@property (nonatomic, assign, getter = isOpaque) BOOL opaque;
// Whether the view's drawing and layout uses a flipped (top-left origin)
// coordinate system.
//
// Defaults to NO.
@property (nonatomic, getter = isFlipped) BOOL flipped;
@property (nonatomic, assign, getter = isFlipped) BOOL flipped;
// Whether the graphics context for the view's drawing should be cleared to
// transparent black in RBLView's implementation of -drawRect:.

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

@ -40,6 +40,14 @@ static IMP RBLViewDrawRectIMP;
self.layer.backgroundColor = color.rbl_CGColor;
}
- (BOOL)clipsToBounds {
return self.layer.masksToBounds;
}
- (void)setClipsToBounds:(BOOL)value {
self.layer.masksToBounds = value;
}
- (BOOL)isOpaque {
return self.layer.opaque;
}