iImprove image caching

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5609 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1999-12-22 12:08:24 +00:00
parent ea78ff53a9
commit cfd932f104
2 changed files with 11 additions and 5 deletions

View file

@ -1,3 +1,9 @@
Wed Dec 22 12:04:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* Source/NSImage.m: When creating an off-screen cache, fill with
the background color (so having multiple caches for different
backgrounds will work).
Wed Dec 22 10:08:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk> Wed Dec 22 10:08:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* Source/NSWindow.m: ([-sendEvent:]) reset _lastDragView on exit from * Source/NSWindow.m: ([-sendEvent:]) reset _lastDragView on exit from

View file

@ -600,17 +600,17 @@ static Class cacheClass = 0;
*/ */
if (repd->bg == nil) if (repd->bg == nil)
{ {
NSRect bounds; NSRect drawRect = NSMakeRect(0, 0, _size.width, _size.height);
[self lockFocusOnRepresentation: rep]; [self lockFocusOnRepresentation: rep];
bounds = [_lockedView bounds];
if (_color != nil && [_color alphaComponent] != 0.0) if (_color != nil && [_color alphaComponent] != 0.0)
{ {
NSRect bounds = [_lockedView bounds];
[_color set]; [_color set];
NSEraseRect(bounds); NSRectFill(bounds);
} }
[self drawRepresentation: repd->original [self drawRepresentation: repd->original inRect: drawRect];
inRect: NSMakeRect(0, 0, _size.width, _size.height)];
[self unlockFocus]; [self unlockFocus];
if (_color == nil) if (_color == nil)
{ {