Skip to content

Add drawing types templates - #628

Merged
Andrew Arnott (AArnott) merged 7 commits into
microsoft:mainfrom
elachlan:626
Aug 3, 2022
Merged

Andrew Arnott (AArnott) merged 7 commits into
microsoft:mainfrom
elachlan:626

Conversation

@elachlan

@elachlan Lachlan Ennis (elachlan) commented Jul 28, 2022 •

Copy link
Copy Markdown
Contributor

Fixes #626
Related: dotnet/winforms#7468

@elachlan

Copy link
Copy Markdown
Contributor Author

CC: Loni Tra (@lonitra)

@AArnott Andrew Arnott (AArnott) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks like you added the functionality all right where it fits the design. Thank you. Just a couple of changes, please.

The `SIZE` and and `RECT` structs have no BCL equivalents, at least not with the fields in the right order.

@AArnott Andrew Arnott (AArnott) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It turns out that SIZE cannot be replaced with the BCL Size struct because the fields are in a different order. I moved POINT and POINTF to another dictionary in the generator so that they are never generated, even when not marshaling, since the BCL struct types should be adequate and this gives an even better interop experience. I deleted the point templates since we never generate those types any more.
Thank you for starting on this, for the tests and the rect and size templates. This is definitely an improvement.

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.

Consider adding cast operators to System.Drawing types

2 participants