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

Add isStroked overload for IGeometryContext #15430

Merged
merged 11 commits into from
Apr 30, 2024
Merged

Add isStroked overload for IGeometryContext #15430

merged 11 commits into from
Apr 30, 2024

Conversation

emmauss
Copy link
Contributor

@emmauss emmauss commented Apr 18, 2024

What does the pull request do?

Reopens this PR #12617

What is the current behavior?

What is the updated/expected behavior with this PR?

How was the solution implemented (if it's not obvious)?

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0047444-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0047493-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@kekekeks
Copy link
Member

Does it handle closed geometries properly? Last time we've discovered that simple MoveTo isn't enough

@kekekeks
Copy link
Member

It's a bit more complicated than we've thought, simple MoveTo would break closed paths since Skia interprets MoveTo as a new figure.

So if we want to close a figure with holes, we need to prepend the last continuous segment at the start of said figure and replace the initial MoveTo with LineTo.

image

c.BeginFigure(new Point(40,10), true, true);
c.LineTo(new Point(50, 10), true, true);
c.LineTo(new Point(50, 20), false, true);
c.Close();

@emmauss
Copy link
Contributor Author

emmauss commented Apr 19, 2024

Does it handle closed geometries properly? Last time we've discovered that simple MoveTo isn't enough

Yes, it does.
image

@kekekeks
Copy link
Member

Can we have some render tests? Preferably using CrossTest kit for WPF comparison.

@emmauss
Copy link
Contributor Author

emmauss commented Apr 24, 2024

Added test

@jmacato
Copy link
Member

jmacato commented Apr 25, 2024

@cla-avalonia recheck

@cla-avalonia
Copy link
Collaborator

cla-avalonia commented Apr 25, 2024

  • All contributors have signed the CLA.

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0047754-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@emmauss
Copy link
Contributor Author

emmauss commented Apr 25, 2024

@cla-avalonia agree

@maxkatz6 maxkatz6 added the backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch label Apr 26, 2024
@maxkatz6 maxkatz6 merged commit 0aaa591 into master Apr 30, 2024
12 checks passed
@maxkatz6 maxkatz6 deleted the stroke_line branch April 30, 2024 00:41
maxkatz6 pushed a commit that referenced this pull request May 8, 2024
* add isStroked overload for IGeometryContext

* move IGeometryContextEx

* fix Fill Path line

* remove added whitespaces

* close a figure to non-stroke lines with a line

* add geometry tests

* add wpf test files

* Added a test for tracking path closure with missing strokes for various line caps/joins

* add IsStroke overload for other segments

* update tests

* Skip line join test for closed geometry with holes for now

---------

Co-authored-by: Nikita Tsukanov <keks9n@gmail.com>
@maxkatz6 maxkatz6 added backported-11.1.x and removed backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels May 8, 2024
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.

None yet

6 participants