[reportlab-users] Problem with KeepInFrame in 2.1
Roberto Alsina
ralsina at netmanagers.com.ar
Mon Sep 1 06:48:50 EDT 2008
On Monday 01 September 2008 07:05:54 Robin Becker wrote:
> 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.
I'll just switch the default to shrink.
> ReportLab's box model is arguably wrong as we don't really deal with stroke
> width.
--
("\''/").__..-''"`-. . Roberto Alsina
`9_ 9 ) `-. ( ).`-._.`) KDE Developer (MFCH)
(_Y_.)' ._ ) `._`. " -.-' http://lateral.netmanagers.com.ar
_..`-'_..-_/ /-'_.' The 6,855th most popular site of Slovenia
(l)-'' ((i).' ((!.' according to alexa.com (27/5/2007)
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it. --Brian W. Kernighan
More information about the reportlab-users
mailing list