mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-04 11:50:42 +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
|
@ -1,3 +1,9 @@
|
||||||
|
2002-08-23 02:39 Alexander Malmberg <alexander@malmberg.org>
|
||||||
|
|
||||||
|
* Source/NSImage.m (-lockFocusOnRepresentation:): Use a
|
||||||
|
compositerect to clear the alpha channel if the background color
|
||||||
|
isn't opaque.
|
||||||
|
|
||||||
2002-08-16 Adam Fedor <fedor@gnu.org>
|
2002-08-16 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
* Source/NSGraphicsContext.m: Define colorspace constants
|
* Source/NSGraphicsContext.m: Define colorspace constants
|
||||||
|
|
|
@ -899,6 +899,19 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
|
||||||
{
|
{
|
||||||
repd->bg = [_color copy];
|
repd->bg = [_color copy];
|
||||||
[_color set];
|
[_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));
|
NSRectFill(NSMakeRect(0, 0, _size.width, _size.height));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue