[cairo] Transformation order : erratum

mydevel at free.fr mydevel at free.fr
Tue Dec 5 02:13:45 PST 2006


On Monday 04 December 2006 00:59, Behdad Esfahbod wrote:
> On Sun, 2006-12-03 at 11:32 +0100, mydevel at free.fr wrote:
> > On Saturday 02 December 2006 23:26, Behdad Esfahbod wrote:
> > > On Sat, 2006-12-02 at 05:25 -0500, mydevel at free.fr wrote:
> > > > In fact, I get the same wrong result in both cases with PDF; so it
> > > > may be a
> > > > bug in the PDF backend.
> > >
> > > Are you using OS X by any chance?  There was a bug with scales in the
> > > PDF backend that only was exposed on the OS X viewer, and is fixed in
> > > 1.2.6.
> >
> > Thanks for your reply. I'm on linux and I use both acroread and xpdf as
> > viewers. I fixed the problem by clipping for now.
>
> Do you mind sending us a minimal test case?
>

Hello,

Here its is - note that I'm a pythonist, so I use pycairo :

import cairo

SIZE = 500
FILEBASE = "testcase"

surface = cairo.PDFSurface(FILEBASE+".pdf",SIZE,SIZE)
ctx = cairo.Context(surface)
image = cairo.ImageSurface.create_from_png("red.png") # any image
ctx.translate(SIZE/2,0)
ctx.scale(0.2,0.4) # any scale <1
ctx.set_source_surface(image, 0, 0)
ctx.paint()
surface.write_to_png(FILEBASE+".png") # that one is OK
ctx.show_page() # but PDF renders a cyclic pattern
surface.finish()



--

I do not know if we can send attachments to this list, so I did not attach the 
pdf result.


Sincerely,

Romuald.


More information about the cairo mailing list