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,31 +569,42 @@ static inline NSRect integralRect (NSRect rect, NSView *view)
- (void) setBackgroundColor: (NSColor*)aColor - (void) setBackgroundColor: (NSColor*)aColor
{ {
ASSIGN (_backgroundColor, aColor); if (![_backgroundColor isEqual: aColor])
if (_drawsBackground == NO || _backgroundColor == nil
|| [_backgroundColor alphaComponent] < 1.0)
{ {
_isOpaque = NO; ASSIGN (_backgroundColor, aColor);
}
else [self setNeedsDisplay: YES];
{
_isOpaque = YES; if (_drawsBackground == NO || _backgroundColor == nil
|| [_backgroundColor alphaComponent] < 1.0)
{
_isOpaque = NO;
}
else
{
_isOpaque = YES;
}
} }
} }
- (void) setDrawsBackground:(BOOL)flag - (void) setDrawsBackground:(BOOL)flag
{ {
_drawsBackground = flag; if (_drawsBackground != flag)
{
_drawsBackground = flag;
if (_drawsBackground == NO || _backgroundColor == nil [self setNeedsDisplay: YES];
|| [_backgroundColor alphaComponent] < 1.0)
{ if (_drawsBackground == NO || _backgroundColor == nil
_isOpaque = NO; || [_backgroundColor alphaComponent] < 1.0)
} {
else _isOpaque = NO;
{ }
_isOpaque = YES; else
{
_isOpaque = YES;
}
} }
} }