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
282 stars 38 forks source link

Fix casting of list of textruns #333

Closed stefannikolei closed 1 month ago

stefannikolei commented 3 months ago

Directly casting is not possible. That's why using the Cast method is the easiest way

Fixes #332

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 80%. Comparing base (ac272a2) to head (ce0f50c). Report is 13 commits behind head on main.

Files Patch % Lines
...c/ImageSharp.Drawing/Processing/RichTextOptions.cs 0% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #333 +/- ## =================================== Coverage 80% 80% =================================== Files 97 97 Lines 4960 4971 +11 Branches 886 888 +2 =================================== + Hits 4011 4023 +12 + Misses 754 753 -1 Partials 195 195 ``` | [Flag](https://app.codecov.io/gh/SixLabors/ImageSharp.Drawing/pull/333/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SixLabors) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/SixLabors/ImageSharp.Drawing/pull/333/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SixLabors) | `80% <0%> (+<1%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SixLabors#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

JimBobSquarePants commented 3 months ago

Would direct casting not work if we explicitly set an empty array as the default value?

JimBobSquarePants commented 1 month ago

Thanks @stefannikolei for this. I'm going to close it though as I've added a fix to #335 that assigns the empty array.