зеркало из https://github.com/github/Rebel.git
Merge pull request #43 from github/clipsToBounds
Add RBLView clipsToBounds property
This commit is contained in:
Коммит
2763201ad1
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче