SixLabors / ImageSharp.Drawing

:pen: Extensions to ImageSharp containing a cross-platform 2D polygon manipulation API and drawing operations.
https://sixlabors.com/products/imagesharp-drawing/
Other
286 stars 39 forks source link

Fix arcs and do not throw when outlining #302

Closed JimBobSquarePants closed 1 year ago

JimBobSquarePants commented 1 year ago

Prerequisites

Description

Fixes #299, #300

The way I was handling arc generation when the arc sweep represented a closed ellipse didn't take into consideration the start angle.

Fixing the issue meant that we threw during outlining when someone requested the short arc so I fixed the offsetter to return the unclipped path I also fixed the handling of paths containing a single point.

codecov[bot] commented 1 year ago

Codecov Report

Merging #302 (edb6db2) into main (dfae51c) will increase coverage by 0%. The diff coverage is 92%.

@@         Coverage Diff         @@
##           main   #302   +/-   ##
===================================
  Coverage    80%    80%           
===================================
  Files        97     97           
  Lines      4937   4937           
  Branches    878    881    +3     
===================================
+ Hits       3975   3990   +15     
+ Misses      769    753   -16     
- Partials    193    194    +1     
Flag Coverage Δ
unittests 80% <92%> (+<1%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/ImageSharp.Drawing/Shapes/ArcLineSegment.cs 96% <100%> (+<1%) :arrow_up:
...mageSharp.Drawing/Shapes/PolygonClipper/BoundsF.cs 28% <ø> (+28%) :arrow_up:
....Drawing/Shapes/PolygonClipper/PolygonOffsetter.cs 74% <60%> (+1%) :arrow_up:

... and 2 files with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more