[reportlab-users] Scaled Flowables consuming too much space in Platypus?

Robin Becker reportlab-users@reportlab.com
Mon, 16 Sep 2002 17:49:59 +0100


Well to be a flowable you need to be a Drawing as that has dimensions
and is a flowable.

I guess we either need to redefine scale for Drawings or to define some
new concept like resize that does the scale and the dimension change. I
suspect that you need to do something like

        def resize(self,width,height):
                owidth, oheight = self.width, self.height
                self.width, self.height = width, height
                self.scale(owidth/float(width), oheight/float(height))

or
        def rescale(self,xscale,yscale):
                self.scale(xscale,yscale)
                self.width *= abs(xscale)
                self.height *= abs(yscale)

I think the latter works even if you do a negative flip on one or both
of the axes, but I think this is why we want to keep the frame size away
from the geometric operations. If we allow scale to affect the drawing
size then why not rotate, shear and more general affine transforms. 
-- 
Robin Becker