Skip to content

Commit

Permalink
Use correct fill rule when rendering SVG paths (#1606)
Browse files Browse the repository at this point in the history
* Use correct fill rule when rendering SVG paths

* Update CHANGELOG.md
  • Loading branch information
SecondFlight authored Feb 20, 2021
1 parent 47fb9fb commit f51a436
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ You can find its changes [documented below](#070---2021-01-01).
### Fixed

- Fixed docs of derived Lens ([#1523] by [@Maan2003])
- Use correct fill rule when rendering SVG paths ([#1606] by [@SecondFlight])

### Visual

Expand Down Expand Up @@ -420,6 +421,7 @@ Last release without a changelog :(
[@lassipulkkinen]: https://github.com/lassipulkkinen
[@Poignardazur]: https://github.com/PoignardAzur
[@HoNile]: https://github.com/HoNile
[@SecondFlight]: https://github.com/SecondFlight

[#599]: https://github.com/linebender/druid/pull/599
[#611]: https://github.com/linebender/druid/pull/611
Expand Down Expand Up @@ -622,6 +624,7 @@ Last release without a changelog :(
[#1592]: https://github.com/linebender/druid/pull/1592
[#1596]: https://github.com/linebender/druid/pull/1596
[#1600]: https://github.com/linebender/druid/pull/1600
[#1606]: https://github.com/linebender/druid/pull/1606

[Unreleased]: https://github.com/linebender/druid/compare/v0.7.0...master
[0.7.0]: https://github.com/linebender/druid/compare/v0.6.0...v0.7.0
Expand Down
6 changes: 5 additions & 1 deletion druid/src/widget/svg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,11 @@ impl SvgRenderer {
match &p.fill {
Some(fill) => {
let brush = self.brush_from_usvg(&fill.paint, fill.opacity, ctx);
ctx.fill(path.clone(), &*brush);
if let usvg::FillRule::EvenOdd = fill.rule {
ctx.fill_even_odd(path.clone(), &*brush);
} else {
ctx.fill(path.clone(), &*brush);
}
}
None => {}
}
Expand Down

0 comments on commit f51a436

Please sign in to comment.