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

@ -568,9 +568,13 @@ static inline NSRect integralRect (NSRect rect, NSView *view)
} }
- (void) setBackgroundColor: (NSColor*)aColor - (void) setBackgroundColor: (NSColor*)aColor
{
if (![_backgroundColor isEqual: aColor])
{ {
ASSIGN (_backgroundColor, aColor); ASSIGN (_backgroundColor, aColor);
[self setNeedsDisplay: YES];
if (_drawsBackground == NO || _backgroundColor == nil if (_drawsBackground == NO || _backgroundColor == nil
|| [_backgroundColor alphaComponent] < 1.0) || [_backgroundColor alphaComponent] < 1.0)
{ {
@ -582,10 +586,16 @@ static inline NSRect integralRect (NSRect rect, NSView *view)
} }
} }
}
- (void) setDrawsBackground:(BOOL)flag - (void) setDrawsBackground:(BOOL)flag
{
if (_drawsBackground != flag)
{ {
_drawsBackground = flag; _drawsBackground = flag;
[self setNeedsDisplay: YES];
if (_drawsBackground == NO || _backgroundColor == nil if (_drawsBackground == NO || _backgroundColor == nil
|| [_backgroundColor alphaComponent] < 1.0) || [_backgroundColor alphaComponent] < 1.0)
{ {
@ -596,6 +606,7 @@ static inline NSRect integralRect (NSRect rect, NSView *view)
_isOpaque = YES; _isOpaque = YES;
} }
} }
}
- (BOOL) drawsBackground - (BOOL) drawsBackground
{ {