[reportlab-users] Implementation of drawImage anchoring

Yoann Roman yroman-reportlab at altalang.com
Thu Sep 4 09:11:34 EDT 2008


Andy Robinson wrote...

> 2008/8/22 Yoann Roman <yroman-reportlab at altalang.com>:

> > I've been reading (and re-reading) the doc for drawImage in Canvas, and

> > I'm pretty sure the implementation doesn't match what's described. To

> > quote:

>

> Yoann, I wasn't following this last week, but I have just read this thread

> and I think you (and the docs) are right and our implementation is wrong.

>

> [snip]

>

> We will try to fix this and add a test case in the open source distro.


Should it help, I've attached my boxstuff.py patch to implement the
documented behavior. anchorAdjustXY now returns (x, y) unchanged, but I left
it as is to avoid patching canvas.py and pdfimages.py, too.

I've also attached boxstuff_tests.py, which I used to check my math. It's
certainly not exhaustive in the image dimensions it checks against.

HTH,

--
Yoann Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: boxstuff.diff
Type: application/octet-stream
Size: 1493 bytes
Desc: not available
Url : <http://two.pairlist.net/pipermail/reportlab-users/attachments/20080904/715882f4/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: boxstuff_tests.py
Url: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20080904/715882f4/attachment.ksh>


More information about the reportlab-users mailing list