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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
May 29, 2022

Conversation

tocsoft
Copy link
Member

@tocsoft tocsoft commented May 29, 2022

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
Copy link

codecov bot commented May 29, 2022

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.

Copy link
Member

@JimBobSquarePants JimBobSquarePants left a comment

Choose a reason for hiding this comment

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

Ace! 馃憤

@tocsoft tocsoft merged commit 5f1c7c2 into main May 29, 2022
@JimBobSquarePants JimBobSquarePants deleted the sw/issue-224-outline-infinate-loop branch August 15, 2023 01:10
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