mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-02 04:41:00 +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
733c73213c
commit
c23acc7a91
1 changed files with 29 additions and 18 deletions
|
@ -568,9 +568,13 @@ 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)
|
||||
{
|
||||
|
@ -582,10 +586,16 @@ static inline NSRect integralRect (NSRect rect, NSView *view)
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (void) setDrawsBackground:(BOOL)flag
|
||||
{
|
||||
if (_drawsBackground != flag)
|
||||
{
|
||||
_drawsBackground = flag;
|
||||
|
||||
[self setNeedsDisplay: YES];
|
||||
|
||||
if (_drawsBackground == NO || _backgroundColor == nil
|
||||
|| [_backgroundColor alphaComponent] < 1.0)
|
||||
{
|
||||
|
@ -596,6 +606,7 @@ static inline NSRect integralRect (NSRect rect, NSView *view)
|
|||
_isOpaque = YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL) drawsBackground
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue