diff --git a/ChangeLog b/ChangeLog index 4011eb880..b8f8463ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-08-23 02:39 Alexander Malmberg + + * Source/NSImage.m (-lockFocusOnRepresentation:): Use a + compositerect to clear the alpha channel if the background color + isn't opaque. + 2002-08-16 Adam Fedor * Source/NSGraphicsContext.m: Define colorspace constants diff --git a/Source/NSImage.m b/Source/NSImage.m index b7b60dea0..1cfc48b11 100644 --- a/Source/NSImage.m +++ b/Source/NSImage.m @@ -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)); } }