NGraphics is a cross platform library for rendering vector graphics on .NET. It provides a unified API for both immediate and retained mode graphics using high quality native renderers.
I'd like to implement support for group opacity by:
Adding support for opacity as a short for fill-opacity (will affect both pen and brush) on elements
Adding support for multiplying the group's opacity with its children's pen/brush opacity.
Solution:
To avoid changing too many classes we can let the Group object visit its children before and after drawing to change its children's alpha values (pens and brushes).
Visiting children should not be performed if no opacity is set on the group.
Subsequent assignments to the group's opacity property should not result in alpha values growing in either direction.
As per the Svg 1.1 reference, a group or container element can have an opacity setting:
14.5 Object and group opacity: the ‘opacity’ property
I'd like to implement support for group opacity by:
Solution: