On Sat, 18 Sep 2010 21:52:50 +0200
Peter Korsgaard <[email protected]> wrote:

> Signed-off-by: Peter Korsgaard <[email protected]>
> ---
>  include/svgtiny.h      |   11 +++++++----
>  src/svgtiny.c          |   35 +++++++++++++++++++++++++++++++++++
>  src/svgtiny_internal.h |    2 ++
>  3 files changed, 44 insertions(+), 4 deletions(-)

I noticed a couple of bugs in this when testing.

1. If an fill-opacity is given in an ancestor element of an element that
   has a fill, the opacity gets lost. The reason is that
   svgtiny_parse_color() overwrites it. That could be avoided by doing a
   similar logical operation there to the one in
   svgtiny_parse_opacity(). For example
   http://www.croczilla.com/bits_and_pieces/svg/samples/circles1/circles1.svg

2. Gradient fills use a special value for state->fill:

     #define svgtiny_LINEAR_GRADIENT 0x2000000

   That would conflict with the opacity.

I think the best solution to both of these may be to split opacity into
separate members of struct svgtiny_parse_state, and only combine it
when creating a svgtiny_shape.

Otherwise it looks good and I'll try and fix this and check it in soon.

James

Reply via email to