Automatically mark the NSClipView as needing redisplay when the background

color - or the drawsBackground flag - changes


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@11631 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
nico 2001-12-05 13:01:43 +00:00
parent 733c73213c
commit c23acc7a91

View file

@ -569,8 +569,12 @@ static inline NSRect integralRect (NSRect rect, NSView *view)
- (void) setBackgroundColor: (NSColor*)aColor
{
if (![_backgroundColor isEqual: aColor])
{
ASSIGN (_backgroundColor, aColor);
[self setNeedsDisplay: YES];
if (_drawsBackground == NO || _backgroundColor == nil
|| [_backgroundColor alphaComponent] < 1.0)
{
@ -580,12 +584,18 @@ static inline NSRect integralRect (NSRect rect, NSView *view)
{
_isOpaque = YES;
}
}
}
- (void) setDrawsBackground:(BOOL)flag
{
if (_drawsBackground != flag)
{
_drawsBackground = flag;
[self setNeedsDisplay: YES];
if (_drawsBackground == NO || _backgroundColor == nil
|| [_backgroundColor alphaComponent] < 1.0)
{
@ -595,6 +605,7 @@ static inline NSRect integralRect (NSRect rect, NSView *view)
{
_isOpaque = YES;
}
}
}
- (BOOL) drawsBackground