Cleaning up the paint API of KoShape

Yue Liu opuspace at gmail.com
Sun Jan 23 15:31:18 GMT 2011


On Sun, Jan 23, 2011 at 10:36 PM, Inge Wallin <inge at lysator.liu.se> wrote:
> There is a big wart on the KoShape API and that is the one for painting.
> Currently we have these two functions:
>
>  virtual void paint(QPainter &painter, const KoViewConverter &converter) = 0;
>  virtual void paintDecorations(QPainter &painter,
>                              const KoViewConverter &converter,
>                              const KoCanvasBase *canvas);
>
> The biggest problem is the KoViewConverter parameter.  There is no reason why
> this should be necessary. It should be the responsibility of the calling code
> to set up the painter so that the shape itself can just paint from (0, 0) to
> size() and that's it (if we for the moment ignore painting outside the shape).
I don't know what's the meaning of ignore painting outside the shape,
just to mention that blur effect to drop-shadow caused the actual
shadow size bigger than the shape size, there are some pixels outside
the shape need to be painted.

-- 
Yue Liu



More information about the calligra-devel mailing list