Idea for solving shadow overlap issue

Yue Liu opuspace at gmail.com
Tue Apr 19 09:55:24 BST 2011


Hello,

To solve the shadow-overlap-other-shapes issue, I got an idea but not sure
whether it is done right.
The problem currently is, if we add shadow to a stencil(which is a shape
group), shadows to the child shape would overlap each other. Even if we put
all the shadows behind the child shapes, the intersection of two blured
shadows would change the weight that the outer shadow of the stencil should
have.
So my plan is to change something in KoShapeShadow, KoShapeGroup and
KoShapeManager.

I want to introduce draw:shadow as an available style to the <draw:g>
element.
The result to the user would be: when a group is selected, shadow will only
apply to the group as a whole, if user want all the child shapes inside the
group to have their own shadows, the user have to ungroup and select all the
child shapes, then add shadow and re-group.

First something should be changed in shapeManager->selection or
KoShapeShadow, so that when adding shadow to a group, shadow is only added
to the top-level shape, that is the group.
When drawing a shadow, first check if the selected shape is a group. If it
is, a clip region that capable of holding the whole group is created, then
background and borders to all the child shapes are painted to the clip
region in the shadow color. If blur effect is used, the clip region would be
blured before painted to the canvas.

To decide the size of the clip region the size value to the KoShapeGroup
should not be 0, if that cause a problem in other codes we can add a
contentSize variant.

The idea solved the problem I met and won't change the correct alpha value
to the blured shadow.

What do you think about it?

-- 
Yue Liu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20110419/508bb94e/attachment.htm>


More information about the calligra-devel mailing list