discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Printing with xlib & art backend


From: Fred Kiefer
Subject: Re: Printing with xlib & art backend
Date: Sun, 07 Jul 2013 17:23:58 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6

I commited Erics patch, Riccardo could you please give it a try and see whether printing is back to the old state?

On 07.07.2013 02:36, Eric Wasylishen wrote:
Hi Riccardo,

I had a look and it seems I took out this chunk of code which existed in gui 
0.22.0's version of -guiDrawInRect:fromRect:operation:fraction:

   if (![ctxt isDrawingToScreen])
     {
       /* We can't composite or dissolve if we aren't drawing to a screen,
          so we'll just draw the right part of the image in the right
          place. */
       NSPoint p;
       double fx, fy;

       fx = dstRect.size.width / srcRect.size.width;
       fy = dstRect.size.height / srcRect.size.height;

       p.x = dstRect.origin.x / fx - srcRect.origin.x;
       p.y = dstRect.origin.y / fy - srcRect.origin.y;

       DPSgsave(ctxt);
       DPSrectclip(ctxt, dstRect.origin.x, dstRect.origin.y,
                   dstRect.size.width, dstRect.size.height);
       DPSscale(ctxt, fx, fy);
       [self drawRepresentation: [self bestRepresentationForDevice: nil]
             inRect: NSMakeRect(p.x, p.y, s.width, s.height)];
       DPSgrestore(ctxt);

       return;
     }

That explains why printing images worked with xlib and art at that time, and 
doesn't now.

I think re-adding that block of code will fix the problem, making any changes 
necessary to the coordinates so it works with the current codebase.  It may be 
worth checking the history of NSImage/NSImageRep to see if there was any 
comment made in the change log / svn history when that was removed.

I'm on vacation for the next week or so and won't have a chance to do it in 
that time.

Eric





reply via email to

[Prev in Thread] Current Thread [Next in Thread]