Vincent van Ravesteijn - TNW wrote:
PS. This is also a work-around around the recursive repaint bug.
Could you please elaborate a bit?
The recursive repaint bug occurs when you drag the math-toolbar while
the document is scrolled all the way down. This means that there will be
space that is filled by scrolling down the doc.
It strikes me that we resize the BufferView within a paint event. This
feels like asking for problems. Anyway, we resize and paint the
bufferView, but then we update the scrollbars. This will automatically
scroll down the document and inevitably lead to a new repaint.
If you now allow a little bit of grey to exist below the document (which
is the case with this new feature) the document will not automatically
scroll down, and we do not get the repaint bug.
Wouldn't it be natural to resize the bufferView and update the
scrollbars in resizeEvent and only paint the bufferView in paintEvent ?
No, beacuse a BufferView resize is basically just a full repaint and
there should be no paint operation inside the resizeEvent, and the
BufferView resize involves a painting operation onto a Pixmap. I
explicitely remove any painting from the resizeEvent and delayed the
BufferView resize until the next paint event because of that.
Abdel.