[reportlab-users] Problem with KeepInFrame in 2.1
Roberto Alsina
ralsina at netmanagers.com.ar
Sun Aug 31 10:49:11 EDT 2008
On Sunday 31 August 2008 09:59:01 Robin Becker wrote:
> Roberto Alsina wrote:
> > Hello,
> >
> > When using a KeppInFrame in "truncate" mode, it eats the border of a
> > XPreformatted inside it.
> >
> > I am generating the KeepInFrame like this:
> >
> >
> > KeepInFrame(2000*cm,2000*cm,content=[XPreformatted(text,style)],mode="tru
> >ncate")
> >
> > I use the silly 2000*cm so it's actually using the size of the frame it's
> > in at wrapping time.
>
> I'm not certain exactly what you mean by eats the border since I don't
> see anything obviously wrong in your 15 page example and I don't know
> what you intend things to look like. Can you say which page contains the
> eaten xpreformatted and what it should look 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.
--
("\''/").__..-''"`-. . 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