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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implenting addArc feature #144

Merged
merged 24 commits into from
Sep 9, 2021
Merged

Implenting addArc feature #144

merged 24 commits into from
Sep 9, 2021

Conversation

derBobo
Copy link
Contributor

@derBobo derBobo commented Jun 18, 2021

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

This should implement the requested features from #4

@CLAassistant
Copy link

CLAassistant commented Jun 18, 2021

CLA assistant check
All committers have signed the CLA.

@derBobo
Copy link
Contributor Author

derBobo commented Jun 18, 2021

Currently the transformation feature is still not completed, I think there are two ways to implement this:

  1. (current code tries this) Calculate everything, annoying because for every angle for two points on the circle there are at least 2 possibilities (clockwise and anticlockwise) .
  2. Every elliptical arc stores it current transformation matrix and uses it to calculate the current points

@antonfirsov
Copy link
Member

@derBobo feel free to go with 2., we can always optimize later, the main goal is to close the feature gap.

@derBobo

This comment has been minimized.

@derBobo
Copy link
Contributor Author

derBobo commented Jun 20, 2021

Should I also change the EllipsePlygon class to use the EllipticalArcLineSegment instead of CubicBezierLineSegment?

@codecov
Copy link

codecov bot commented Jun 21, 2021

Codecov Report

Merging #144 (0087497) into master (d31cc33) will increase coverage by 0.13%.
The diff coverage is 79.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #144      +/-   ##
==========================================
+ Coverage   69.88%   70.02%   +0.13%     
==========================================
  Files          88       89       +1     
  Lines        5144     5207      +63     
  Branches     1052     1062      +10     
==========================================
+ Hits         3595     3646      +51     
- Misses       1338     1347       +9     
- Partials      211      214       +3     
Flag Coverage Δ
unittests 70.02% <79.36%> (+0.13%) ⬆️

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

Impacted Files Coverage Δ
src/ImageSharp.Drawing/Shapes/PathBuilder.cs 88.23% <37.50%> (-5.28%) ⬇️
...geSharp.Drawing/Shapes/EllipticalArcLineSegment.cs 85.45% <85.45%> (ø)
src/ImageSharp.Drawing/Shapes/Clipper/clipper.cs 49.09% <0.00%> (+0.04%) ⬆️

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 d31cc33...0087497. Read the comment docs.

@JimBobSquarePants
Copy link
Member

@derBobo i don’t actually know the answer to that. @tocsoft what do you think?

@tocsoft
Copy link
Member

tocsoft commented Jul 10, 2021

from memory its really an internal implemetation detail on what sort of line segment we are using so I would say unless it makes a noticable/more acurate/faster difference to the output then I personally wouldn't bother. But saying all that as long as we have sufficent test coverage then I can't imagine it would cause too much harm.

@JimBobSquarePants
Copy link
Member

Thanks @tocsoft makes sense!

@derBobo
Copy link
Contributor Author

derBobo commented Jul 24, 2021

does anyone have more ideas fore Xunit tests ?

@antonfirsov
Copy link
Member

does anyone have more ideas fore Xunit tests ?

We need tests that actually draw the EllipticalArcLineSegment.

Example tests doing some drawing of IPath, you can add the new ones here:
https://github.com/SixLabors/ImageSharp.Drawing/blob/master/tests/ImageSharp.Drawing.Tests/Drawing/DrawPathTests.cs

These tests are validating the output agains reference images found here:
https://github.com/SixLabors/ImageSharp.Drawing/tree/master/tests/Images/ReferenceOutput/Drawing/DrawPathTests

The images are Debug-Saved under the folder /Images/ActualOutput/Drawing/DrawPathTests/. If you think the output is correct, just copy the files to the appropriate ReferenceOutput folder.

@derBobo
Copy link
Contributor Author

derBobo commented Aug 28, 2021

I think this feature now is ready for review.

@derBobo derBobo marked this pull request as ready for review August 28, 2021 15:54
@JimBobSquarePants
Copy link
Member

@SixLabors/core would someone have a chance to review this?

Copy link
Member

@tocsoft tocsoft left a comment

Choose a reason for hiding this comment

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

lgtm 👍

@derBobo thanks for this, and your patience in getting this in.

@tocsoft tocsoft merged commit 22c2a27 into SixLabors:master Sep 9, 2021
@derBobo
Copy link
Contributor Author

derBobo commented Sep 10, 2021 via email

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

Successfully merging this pull request may close these issues.

5 participants