mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 15:11:37 +00:00
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:
parent
b4481e1c16
commit
b588777480
1 changed files with 29 additions and 18 deletions
|
@ -569,31 +569,42 @@ static inline NSRect integralRect (NSRect rect, NSView *view)
|
|||
|
||||
- (void) setBackgroundColor: (NSColor*)aColor
|
||||
{
|
||||
ASSIGN (_backgroundColor, aColor);
|
||||
|
||||
if (_drawsBackground == NO || _backgroundColor == nil
|
||||
|| [_backgroundColor alphaComponent] < 1.0)
|
||||
if (![_backgroundColor isEqual: aColor])
|
||||
{
|
||||
_isOpaque = NO;
|
||||
}
|
||||
else
|
||||
{
|
||||
_isOpaque = YES;
|
||||
ASSIGN (_backgroundColor, aColor);
|
||||
|
||||
[self setNeedsDisplay: YES];
|
||||
|
||||
if (_drawsBackground == NO || _backgroundColor == nil
|
||||
|| [_backgroundColor alphaComponent] < 1.0)
|
||||
{
|
||||
_isOpaque = NO;
|
||||
}
|
||||
else
|
||||
{
|
||||
_isOpaque = YES;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (void) setDrawsBackground:(BOOL)flag
|
||||
{
|
||||
_drawsBackground = flag;
|
||||
if (_drawsBackground != flag)
|
||||
{
|
||||
_drawsBackground = flag;
|
||||
|
||||
if (_drawsBackground == NO || _backgroundColor == nil
|
||||
|| [_backgroundColor alphaComponent] < 1.0)
|
||||
{
|
||||
_isOpaque = NO;
|
||||
}
|
||||
else
|
||||
{
|
||||
_isOpaque = YES;
|
||||
[self setNeedsDisplay: YES];
|
||||
|
||||
if (_drawsBackground == NO || _backgroundColor == nil
|
||||
|| [_backgroundColor alphaComponent] < 1.0)
|
||||
{
|
||||
_isOpaque = NO;
|
||||
}
|
||||
else
|
||||
{
|
||||
_isOpaque = YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue