mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 08:41:54 +00:00
Use a compositerect to clear the alpha channel if the background color isn't opaque.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14320 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
545659a4f7
commit
debd8691df
2 changed files with 19 additions and 0 deletions
|
@ -899,6 +899,19 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
|
|||
{
|
||||
repd->bg = [_color copy];
|
||||
[_color set];
|
||||
|
||||
if ([_color alphaComponent] < 1)
|
||||
{
|
||||
/* With a Quartz-like alpha model, alpha can't be cleared
|
||||
with a rectfill, so we need to clear the alpha channel
|
||||
explictly. (A compositerect with NSCompositeCopy would
|
||||
be more efficient, but it doesn't seem like it's
|
||||
implemented correctly in all backends yet (as of
|
||||
2002-08-23). Also, this will work with both the Quartz-
|
||||
and DPS-model.) */
|
||||
PScompositerect(0, 0, _size.width, _size.height,
|
||||
NSCompositeClear);
|
||||
}
|
||||
NSRectFill(NSMakeRect(0, 0, _size.width, _size.height));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue