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

List:       koffice-devel
Subject:    Re: Notes on koffice unit tests
From:       Jan Hambrecht <jaham () gmx ! net>
Date:       2007-02-12 10:25:43
Message-ID: 45D040A7.7090706 () gmx ! net
[Download RAW message or body]

Thomas Zander wrote:
> On Monday 12 February 2007 00:45, Jaham wrote:
>> Don't know what you mean by shapeConnection. You probably mean the shape
>> containers?
>> Please correct me if i am wrong, but i understand it that only shapes
>> without a parent (top level shapes) are painted from the shape manager, all
>> child shapes are painted from their parents respectively. That would fix
>> the painting of hidden shapes, because painting is done hierarchically.
>>
>>> If you are interrested in the details; the unit test has more.
>> Your comments inside the test code say that unclipped shapes should be
>> painted by the shape manager, clipped ones from the shapes parent
>> container. So uncommenting lines 97,98 in KoShapeContainer.cpp will fix the
>> first painting test. But that will not fix the painting of hidden shapes.
>> For that case the shape manager has to go up all nesting levels of a
>> particular shape to see if the shape is visible or not. My proposal from
>> above would solve that already.
>>
>> What do you think?
> 
> Your solution would work, but for one little detail :)
> 
> Say, I have a text-shape that is a column of text.
> An image is suppost to move when the parent moves, so its a child-shape.
> The image is positioned just right of the columns of text.  So its not clipped 
> as its suppost to be shown outside the text-shape.
> 
Is the image shape in that case a child of the text shape?

> Now; if I call 'repaint' on the image-shape the shapeManager will get a call 
> with a cliprect of the image-shape.
> The image-shape is never painted by the shapeManager in your solution, only 
> its parent.  But the parent does not intersect the cliprect and thus will 
> never be painted.

Well i would say that is another bug. I think when checking a shape for 
intersection with the cliprect, the bounding rect of the shape 
(including all its children bounding rects) should be tested. So the 
image shapes parent container has a boundingrect of the image shape 
united with all its other child shapes bounding rects. So it will 
intersect the cliprect. Then the image shapes parent gets painted, and 
when painting its children, it checks each of them for intersection with 
the cliprect. That would be true for the image shape which then gets 
painted.

> 
> I like your solution better then the current one.
> So, if you could perhaps alter the shapeManager to _always_ call the paint if 
> the class is a KoShapeContainer that would solve it.
> Additionally, adding some code to the KoShapeContainer that honours the 
> cliprect would be needed so the children would not be painted if that were 
> unneeded.

Yes that is similar to the one i described above. But that would paint a 
child shape container twice. First its parent would be drawn, which 
draws the child container among its other child shapes. The second paint 
would be directly from the shape manager, as it is a shape container 
which is always drawn from the shape manager.

> 
> 
> Hope that makes sense :)
> 
> And thanks for looking into this!

You are welcome! :-)

_______________________________________________
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