[Kst] view object painting needs a rework

George Staikos staikos at kde.org
Wed Dec 21 14:23:41 CET 2005

  After a long frustrating battle with view object painting, I think we have 
to rework it before this release.  There are way too many hacks and way too 
many broken things in there now.  Fixing one thing breaks another.  I have 
some initial thoughts, but basically I think it should work something like 

ViewObject has two paint methods, one virtual, one not.

The non-virtual, called first, paints the children, subtracts them from the 
mask, and passes the mask to the virtual one.

The virtual one calls all the base classes.

A mask is passed downward on the base class calls to avoid the double paint 
flicker problem.

ViewBox no longer inherits from BorderedViewObject since it's not using 
anything from there anyway.

Background painting and background transparency is done by KstViewObject.

There is only one transparent flag and it applies to the background.

Therefore the paint code in each object would look something like:

Base::paint(p, inMask - myMask);
setClipRegion(inMask & myMask);

This could further be simplified by putting it into KstViewObject and having 
the Print/Export test in there to bypass clipping.  The important question 
is, do we lose flexibility that we might need by forcing this algorithm on 
all objects?

George Staikos
KDE Developer				http://www.kde.org/
Staikos Computing Services Inc.		http://www.staikos.net/

More information about the Kst mailing list