Author: fredkiefer
Date: Sun Oct  5 21:59:37 2014
New Revision: 38106

URL: http://svn.gna.org/viewcvs/gnustep?rev=38106&view=rev
Log:
* Source/NSImage.m (-lockFocusOnRepresentation:): Allow image
  caching during printing.

Modified:
    libs/gui/trunk/ChangeLog
    libs/gui/trunk/Source/NSImage.m

Modified: libs/gui/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/ChangeLog?rev=38106&r1=38105&r2=38106&view=diff
==============================================================================
--- libs/gui/trunk/ChangeLog    (original)
+++ libs/gui/trunk/ChangeLog    Sun Oct  5 21:59:37 2014
@@ -1,3 +1,8 @@
+2014-10-04  Fred Kiefer <[email protected]>
+
+       * Source/NSImage.m (-lockFocusOnRepresentation:): Allow image
+       caching during printing.
+
 2014-09-28 04:00-EDT Gregory John Casamento <[email protected]>
 
        * Printing/GNUmakefile: On windows only compile the GSWIN32

Modified: libs/gui/trunk/Source/NSImage.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/NSImage.m?rev=38106&r1=38105&r2=38106&view=diff
==============================================================================
--- libs/gui/trunk/Source/NSImage.m     (original)
+++ libs/gui/trunk/Source/NSImage.m     Sun Oct  5 21:59:37 2014
@@ -57,6 +57,10 @@
 #import "GSThemePrivate.h"
 
 BOOL NSImageForceCaching = NO; /* use on missmatch */
+
+@interface NSView (Private)
+- (void) _lockFocusInContext: (NSGraphicsContext *)ctxt inRect: (NSRect)rect;
+@end
 
 @implementation NSBundle (NSImageAdditions)
 
@@ -1012,9 +1016,14 @@
       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);


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to