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

List:       koffice-devel
Subject:    Re: koffice/libs/flake/tests
From:       Jan Hambrecht <jaham () gmx ! net>
Date:       2009-09-24 8:31:46
Message-ID: 4ABB2E72.8030102 () gmx ! net
[Download RAW message or body]

Thomas Zander wrote:
> On Thursday 24. September 2009 06.00.46 Thorsten Zachmann wrote:
>> What is the purpose of the if in the zIndex() function.
> 
> In flake shapes can have a parent and shapeContainers can have many children.
> This means its a hierarchy of shapes.  Or a tree, for those more visually 
> inclined.
> The zOrder is used to sort relative to the parent. So you get a tree that 
> has its leaves sorted.
> Moving a leaf from one parent to another will thus affect its effective z-
> order, as you would expect.  Again, for the visually inclined, if you have 3 
> shapes that are colored squares, then together they can be grouped to become 
> one. The group is container of the KoShapeGroup and it holds the 3 children. 
> It is impossible to sort something inbetween those 3 shapes. So, any shape 
> that is not also part of the group is either completely above or completely 
> below the 3 child shapes.

Well atm and iirc it is very well possible. Just a short example:

Group 1
   Child1 2
   Child2 3
   Child3 5
Shape 4

This document has a top level group with 3 children and a single top 
level shape (Numbers are the z-Index). Our painting code sorts all 
shapes by their z-Index and paints in that order. So it will paint the 
above shapes in the following order:

Group
Child1
Child2
Shape
Child3

So what we would need to do is when painting is to respect the shape 
hierarchy. So we have to sort the shapes on each level of the hierarchy.
First sort all shapes by their z-Index. Start painting in that order. 
When painting a shape container, sort all of its children by their 
z-Index and start painting them. When painting a shape container, sort 
all of its children by their z-Index and start painting them...

That would ensure what you described above and would also make sure, 
z-Order inside a shape container is handled correctly.

> 
> The 'if' has the comment; // we can't be under our parent.
> Which illustrates this is the reason for it being there. I don't know if 
> this is the best solution, but its one that seemed to have worked so far.

Well obviously it does not work, otherwise we would not discuss these 
matters now, would we?

> If someone makes a patch that effectively removes that line I think we'll 
> have to do a lot of testing to make sure all code still works according to 
> the above design.

As written above, i think this line does not make sure that the above is 
working correctly.

Ciao Jan
_______________________________________________
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