[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Painting on the QImage in QPainter Canvas
From:       "LukasT.dev () gmail ! com" <lukast ! dev () gmail ! com>
Date:       2009-08-16 7:24:03
Message-ID: 200908160924.03321.LukasT.dev () gmail ! com
[Download RAW message or body]

On Saturday 15 August 2009 09:23:48 Ariya Hidayat wrote:
> > I haven't seen Krita code, but the usual way to overcome this problem
> > is to have a persistent "scratch" QImage. Of course this QImage needs
> > to grow and shrink (but not aggressively) according to the said
> > updated rect.
>
> I just saw the patch and it does exactly what I wrote above. A slight
> improvement would be add some hysteresis to the size change detection
> so no need to recreate m_buffer if e.g. the size goes from (100, 100)
> to (99, 99).
>
> One nitpicky point: after recreating m_buffer, it is better to fill it
> with a color of your choice (you know better which color to pick),
> otherwise, if the subsequent drawing does not paint every single
> pixels, you may see some garbage on the screen.

This is already done in the code, we paint border color of the canvas.
So the QPainter fills the drawing buffer first with constant color,
then the checkers are drawn and then the image.

>
> And of course, all this extra indirection can be ignored if the raster
> paint engine is already in use.
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://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