[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: Re: karbon, kpainter and kword
From: Dirk_Schönberger <dirk.schoenberger () sz-online ! de>
Date: 2003-06-17 18:43:28
[Download RAW message or body]
> > so drawGlyph need a QWMatrix parameter
> >
> > void drawGylph (QWMatrix&)
> It's more usual to have the matrix as part of the "state" of the painter,
> like QPainter has worldMatrix().
> That way you can call translate/scale/rotate methods on the painter
> (kword, kpresenter and kotext use painter translation a lot).
KPainter already manages internal state, including a CTM.
The drawGlyph with matrix was introduced because I think it would be a heavy
used call.
So instead of
KPainter kp;
QWMatrix x1 = QWMatrix().scale (.99,1);
QWMatrix x2 = QWMatrix().scale (.98,1);
kp.gsave()
kp.append (x1)
kp.drawGlyph (12);
kp.grestore();
kp.gsave()
kp.scale (x2)
kp.drawGlyph (13);
kp.grestore();
you could do a
KPainter kp;
QWMatrix x1 = QWMatrix().scale (.99,1);
QWMatrix x2 = QWMatrix().scale (.98,1);
kp.drawGlyph (12, x1);
kp.drawGlyph (13, x2);
Regards
Dirk
_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic