Skip to content

Return empty path when outline width is less than or equal to zero - #225

Merged
tocsoft merged 1 commit into
mainfrom
sw/issue-224-outline-infinate-loop
May 29, 2022
Merged

tocsoft merged 1 commit into
mainfrom
sw/issue-224-outline-infinate-loop

Conversation

@tocsoft

@tocsoft tocsoft commented May 29, 2022

Copy link
Copy Markdown
Member

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following matches the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

Updates the GenerateOutline extensions so that when an invalid width (<= 0) is specified that instead of looping it returns an EmptyPath (a new type to represent an empty path without addition allocations).

This resolves #224

@tocsoft
tocsoft requested a review from a team May 29, 2022 11:23
@codecov

codecov Bot commented May 29, 2022

Copy link
Copy Markdown

Codecov Report

Merging #225 (9e2259d) into main (764f6f1) will increase coverage by 0%.
The diff coverage is 61%.

@@         Coverage Diff         @@
##           main   #225   +/-   ##
===================================
  Coverage    71%    71%           
===================================
  Files        87     88    +1     
  Lines      5349   5362   +13     
  Branches   1094   1096    +2     
===================================
+ Hits       3835   3845   +10     
- Misses     1295   1298    +3     
  Partials    219    219           
Flag Coverage Δ
unittests 71% <61%> (+<1%) ⬆️

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

Impacted Files Coverage Δ
src/ImageSharp.Drawing/Shapes/EmptyPath.cs 37% <37%> (ø)
...ImageSharp.Drawing/Shapes/OutlinePathExtensions.cs 100% <100%> (+3%) ⬆️
src/ImageSharp.Drawing/Shapes/Path.cs 75% <100%> (+<1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 764f6f1...9e2259d. Read the comment docs.

@JimBobSquarePants JimBobSquarePants left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ace! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Infinite loop when calling GenerateOutline with width=0 and a dash pattern

2 participants