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

List:       kde-kimageshop
Subject:    Re: Infinite canvas issues
From:       Boudewijn Rempt <boud () valdyas ! org>
Date:       2009-06-30 18:19:32
Message-ID: 200906302019.33259.boud () valdyas ! org
[Download RAW message or body]

On Tuesday 30 June 2009, LukasT.dev@gmail.com wrote:
> Hi,
>
> I implemented infinite canvas and now I need to fix related issues.
>
> The one I don't know much about is about "painting preview". Is it correct
> name for it? When you paint, you see what you paint and just small update
> rectangle is updated. You can watch my problem on video[1]. I tested the
> updating using kwin and its "Show paint" effect but the whole canvas is
> updated in Krita. 

That one is not accurate since it also shows the effects of Qt's internal 
repaints, and if you use effects, there are a lot of them. It's better to 
uncomment the line 

//#define DEBUG_REPAINT

in kis_qpainter_canvas.cpp, that will show accurately what we can control 
about repainting.

> Could you direct me to the code? It is in paintEvent of
> the QPainterCanvas? ev->rect? I tried that but without luck (I moved that
> rect but I did not see what i painted until i scrolled with wheel to
> generate event and have updated widget)
>

The relevant code is in KisQPainterCanvas::paintEvent, and if you look closely 
you can see the likely cause of the problem. From your video, the checkers are 
drawn at a different place from the lines. In the 
KisQPainterCanvas::paintEvent code, you can see that we always draw the 
checkers first and then the line (this is not totally optimal, but that is not 
the question now). 

Now, you can see that checkers are drawn using a translation that uses m_d-
>documentOffset, while the actual cached, prescaled projection is drawn 
directly. And I think that that's the problem: your document offset isn't 
correct here.

-- 
Boudewijn Rempt | http://www.valdyas.org
_______________________________________________
kimageshop mailing list
kimageshop@kde.org
https://mail.kde.org/mailman/listinfo/kimageshop
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic