-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Inline Clipper #265
Inline Clipper #265
Conversation
Codecov Report
@@ Coverage Diff @@
## main #265 +/- ##
=====================================
+ Coverage 61% 78% +17%
=====================================
Files 100 97 -3
Lines 6427 5067 -1360
Branches 1374 932 -442
=====================================
+ Hits 3923 3985 +62
+ Misses 2308 898 -1410
+ Partials 196 184 -12
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
/// <summary> | ||
/// No clipping is performed. | ||
/// </summary> | ||
None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None
only seems useful if we allow choosing the operation via Outline
. I don't know if it's wise to do so since Clipper.Offset uses Union
by default with FillRule.Positive
and FillRule.Negative
which PolygonScanner
does not support.
|
||
namespace SixLabors.ImageSharp.Drawing.Shapes.PolygonClipper | ||
{ | ||
internal struct BoundsF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a good chance this can be removed and we can use RectangleF
I disagree this kind of refactoring is needed. We don't want to maintain (=understand + test) that code. Much better to include the original code as-is (only visibilities changed), and provide a facade on the top, so it is a no-brainer to keep it in sync with the upstream. Refactoring on the other hand gives extra work and has a non-zero chance to introduce bugs. I don't see the value, only downsides. |
That horse has bolted I’m afraid. The refactor to half the memory usage and use Vector2 was significant. I’m happy to track upstream and implement any fixes. |
I didn't know (or missed) that part. If so, it all makes sense. Wasn't able to look at this during the weekend, hope this week I can do it. |
No worries. I found a few things to improve upon this evening anyway. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm 👍
Prerequisites
Description
ClippingOperation
enum toIPath.Clip
viaShapeOptions
. Fixes Add possibility to make intersection of shapes #10#263 should be merged before this as I'll likely have to update the reference file again.
TODO;
PolygonClipper
andPolygonOffsetter
to match standards.ClippingOperation
values.PolygonScanner
needs to support the Clipper fill rulesPositive
andNegative