[Kde-games-devel] KSVGRenderer::render seems to ignore image size
Andreas Pakulat
apaku at gmx.de
Thu Jan 31 07:44:01 CET 2008
On 30.01.08 22:29:55, Aaron J. Seigo wrote:
> On Wednesday 30 January 2008, Mauricio Piacentini wrote:
> > Andreas Pakulat wrote:
> > > I don't quite understand why that happens, the code for the frontsides
> > > is essentially the same, except I'm calling KSVGRenderer::render(
> > > QPaint*, const QString& id ) instead. And that works fine.
> >
> > Welcome to the wild world of QtSvgRenderer! Yes, you need to use a
> > explicit id, otherwise you get strange results depending on how the rect
> > for your document is parsed.
>
> it's not strange at all: it by default sizes to the defined canvas size and
> paints the whole thing into the rect you tell it to. so you can insist on the
> svg's having the document size set to be equal to the size of the card back,
Sorry, but I think I don't follow. Whats "canvas size" and I assume the
"rect" is the one given to render()? If so that rect should be equal to
the QImage I render on, as I don't give a QRectF() to render().
> or else specify the id of the element you want ot render. the latter is
> indeed the safest thing to do.
I'm not sure I have a proper element id for the backside here. It looks
like there's only one element labelled "layer1" in all the backside
svg's, so maybe I can use that one.
Andreas
--
You fill a much-needed gap.
More information about the kde-games-devel
mailing list