[Kst] view object painting needs a rework

Barth Netterfield netterfield at astro.utoronto.ca
Thu Dec 22 00:56:35 CET 2005


On December 21, 2005 05:23 am, George Staikos wrote:
>   After a long frustrating battle with view object painting, I think we
> have to rework it 

agreed

> before this release. 

maybe...

> 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 this:
>
> 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);
> paintMe(p);
>
> 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?

It sounds basically good. Keep in mind:
	-full vector printing.
	-children located relative to contectRect (??) ie, children placed relative 
to 2dplot borders.
	-internal alignment.

cbn


More information about the Kst mailing list