[reportlab-users] Problem with KeepInFrame in 2.1
Robin Becker
robin at reportlab.com
Mon Sep 1 06:05:54 EDT 2008
Roberto Alsina wrote:
........ok like.
>
> Sorry I was not clear.
>
> Look at the preformatted code fragments (the ones with beige background). They
> are supposed to have a border all around them, but only the left edge is
> shown,and the rest is not visible.
>
> If I make the border thicker, it is visible all around, but the left edge is
> always thicker.
>
> Looking a bit harder, it seems the problem is that the border is apparently
> drawn "outside" the XPreformatted's area. Since the KeepInFrame clips like
> this:
>
> p = canv.beginPath()
> p.rect(x, y, self.width,self.height)
> canv.clipPath(p,stroke=0)
>
> The border gets clipped. I don't know why the left edge is still visible,
> though.
>
I just got tow colleagues to look at this document with various viewers and they
both agreed with me that the borders look fine. It is certainly true that
keepInFrame will brutally truncate stuff if you use that mode. Truncate should
logically only be used when you are debugging (there may be other use cases, but
I can't think of them right now). We don't normally want to truncate content.
ReportLab's box model is arguably wrong as we don't really deal with stroke width.
--
Robin Becker
More information about the reportlab-users
mailing list