-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Win2d Path Mini Language Parser added. #3430
Conversation
Thanks ratishphilip for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌 |
|
Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj
Outdated
Show resolved
Hide resolved
@ratishphilip I think the initial build is failing as some files are probably missing the header, you can run the |
…ft.JSON version number
Hey @ratishphilip, we just started to get to take a look at this, but we didn't notice this was coming from your master branch. Can you make sure this is coming from a feature branch in your fork? It gets messy and complex sometimes otherwise going from a master of a fork. Thanks! |
@michael-hawker Could you please let me know if I should abandon this PR and submit a new one. |
@ratishphilip Its too much trouble don't worry about it for this branch. We are starting to add documentation instructing contributors to make feature branches. For the future I would make a feature branch. |
@RosarioPulella the only problem here is that it's harder to resolve the conflict file when it's on the master branch. @ratishphilip if you don't mind, it may be easier to resubmit a new PR from a feature branch, and you can just resolve the conflict at that same point here as well. Sorry for the troubles! |
Ok @michael-hawker, I will make a new PR and resubmit. Kindly reject this PR. |
Closing and waiting for new PR |
@michael-hawker thanks... could you please close the docs PR as well. I will resubmit it. |
Fixes #3421
WPF has a Path Mini Language which is used to describe geometric paths and figures. Support for a similar language does not exist in Win2d library.
CanvasPathGeometry
class aims to resolve that.PR Type
What kind of change does this PR introduce?
Feature
What is the current behavior?
No parser for converting SVG path data to CanvasGeometry exists. Moreover, no mini language exists for defining Brushes, Strokes and StrokeStyles.
What is the new behavior?
I have defined the Win2d Path Mini Language, which is a superset of the Path Language specification in SVG and can be used to define the following
CanvasGeometry
Color
(in hex format orVector4
format)ICanvasBrush
SolidColorBrush
LinearGradientBrush
LinearGradientBrush
withGradientStopHdr
RadialGradientBrush
RadialGradientBrush
withGradientStopHdr
CanvasStrokeStyle
CanvasStroke
which derives fromICanvasStroke
(an interface which encapsulates the attributes of a stroke - Width, Brush, Style and Transform)I have implemented the
CanvasPathGeometry
class which contains a set of static helper methods which enable the parsing of Win2d Path Mini Language as string and convert them to appropriateCanvasGeometry
,Color
,ICanvasBrush
orICanvasStroke
. Also I have added extension methods toCompositor
,CanvasPathBuilder
andCanvasDrawingSession
to build upon the aforementioned helper methods.PR Checklist
Please check if your PR fulfills the following requirements: