Questions about shape group

jaham at gmx.net jaham at gmx.net
Mon May 2 18:51:09 BST 2011


On Thursday 28 April 2011 16:52:17 you wrote:
> Hello Jan,
> 
> Should group be redesigned to be a shape (actually I still don't understand
> why group inherits shape container and shape container inherits koShape but
> group is not a shape) ? 

Well you already found the correct answer. :-) KoShapeGroup is a 
KoShapeContainer which is a KoShape. KoShapeContainer is merely a intermedient 
class which implements functionality needed for all shapes which can contain 
other shapes.

> Now I think things like size() can be calculated
> when needed by iterating all the child shapes without making group a real
> shape. Also make group a real shape may increase the calculation needed for
> every time the geometry changes calculations are needed(or not? I'm not
> quite sure about it)

Yes the shape group has to update its size when one of the grouped shapes 
change their size or position. I think there once was code doing that. And as 
I already wrote in another mail, someone change the group shape to always 
return a zero size. You should find out who that one was, and more importantly 
why that change was done. Then you can fix the real problem which was worked 
around with that change. And then finally you can change it back to have the 
group shape report its correct size.

> 
> And what happens when a filter effect is applied to a group? I'm trying to
> reimplement a roundingRect() method for group and saw that the same method
> in KoShape needs to do something about filter effect stack.

Applying a filter effect to a group used to work, at least at the time I 
implemented it. I am not sure what the roundingRect function should do, or do 
you mean boundingRect ?

Ciao Jan




More information about the calligra-devel mailing list