* Source/NSImage.m (-lockFocusOnRepresentation:): Allow image

caching during printing.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38106 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2014-10-05 19:59:37 +00:00
parent 70baf43d54
commit ab61aefcfa
2 changed files with 17 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2014-10-04 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSImage.m (-lockFocusOnRepresentation:): Allow image
caching during printing.
2014-09-28 04:00-EDT Gregory John Casamento <greg.casamento@gmail.com>
* Printing/GNUmakefile: On windows only compile the GSWIN32

View file

@ -58,6 +58,10 @@
BOOL NSImageForceCaching = NO; /* use on missmatch */
@interface NSView (Private)
- (void) _lockFocusInContext: (NSGraphicsContext *)ctxt inRect: (NSRect)rect;
@end
@implementation NSBundle (NSImageAdditions)
- (NSString*) pathForImageResource: (NSString*)name
@ -1012,9 +1016,14 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
window = [(NSCachedImageRep *)imageRep window];
_lockedView = [window contentView];
if (_lockedView == nil)
[NSException raise: NSImageCacheException
format: @"Cannot lock focus on nil rep"];
[_lockedView lockFocus];
{
[NSException raise: NSImageCacheException
format: @"Cannot lock focus on nil rep"];
}
// FIXME: This is needed to get image caching working while printing. A better solution
// needs to remove the viewIsPrinting variable from NSView.
[_lockedView _lockFocusInContext: [window graphicsContext] inRect: [_lockedView bounds]];
if (repd->bg == nil)
{
NSRect fillrect = NSMakeRect(0, 0, _size.width, _size.height);