Comment 7 for bug 850992

Revision history for this message
Krzysztof Kosinski (tweenk) wrote :

This bug is caused by an interaction between finding the bounding box and updating the group that exposes bugs in shape implementations.

When a new group is created, its SPGroup::update() method chains up to SPItem::update() before updating the children. If the group is filtered, SPItem::update() needs to find the group's bounding box to compute the filter region, and so calls visualBounds(). This in turn calls the children's SPItem::bbox() virtual function. SPShape::bbox() uses _curve to compute the bounding box. Unfortunately, most shape implementations only set _curve from their parameters when update() is called on them, and do not reimplement SPItem::bbox(). As a result, the group receives an empty bounding box and sets that as the filter region, which causes the group to disappear until updateDisplay() is called again.

This bug can be fixed in 3 ways:
1) Update _curve in shape implementations in response to the set() virtual method.
2) Provide implementations fo bbox() that do not rely on _curve.
3) Last resort hack: chain up twice in SPGroup::update(), once at the beginning and once at the end. This might break various other things.