Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"fill-opacity" style is ignored if "opacity" is less than 1 #112

Closed
nuc134r opened this issue Oct 8, 2019 · 2 comments
Closed

"fill-opacity" style is ignored if "opacity" is less than 1 #112

nuc134r opened this issue Oct 8, 2019 · 2 comments
Assignees
Labels

Comments

@nuc134r
Copy link

nuc134r commented Oct 8, 2019

Hello. Thank you for this beautiful library.

We ran into this problem after update to version 1.3.0. Specification of fill-opacity style has no effect if opacity is less than 1. The minimal example I came up with is two rectangles taking two halves of the canvas. One with solid fill-opacity and another is half-transparent. Overall opacity for both is 0.99.

On version 1.2.0 it renders correctly:

image

On version 1.3.0 it paints both rects with the same opacity:

image

This is how Chrome renders this image, as a source of truth:

image

The example SVG code:

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:xlink="http://www.w3.org/1999/xlink"
   width="48px"
   height="48px"
   version="1.1">
  <g>
    <rect
       style="opacity:0.99;fill:#fe2b2b;fill-opacity:1;"
       width="24"
       height="48" />
  </g>
  <g>
    <rect
       style="opacity:0.99;fill:#fe2b2b;fill-opacity:0.5;"
       width="24"
       x="24"
       height="48" />
  </g>
</svg>
@paulushub paulushub self-assigned this Oct 8, 2019
paulushub added a commit that referenced this issue Oct 10, 2019
- Text-alignment support in SVG fonts
- Improved SVG font selection and handling
- Fixed caching issue in the embedded image visitors
- Fixed bug in rgba color support
- Fixed opacity bug in paths having both opacity and fill-opacity attributes #112
@paulushub
Copy link
Contributor

@nuc134r Thanks for reporting this issue. I think this is now fixed in the latest commit. ff7f882
Please verify this.

@nuc134r
Copy link
Author

nuc134r commented Nov 5, 2019

Fixed in 1.4.0. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants