-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix getting stock objects #3774
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
Conversation
Stock objects have a different define in metafile records. Correct values for API usage. Add rectangle validation to the EMF validator and add regression tests for button and the Interop definitions.
| using var emf = new EmfScope(); | ||
| form.PrintToMetafile(emf); | ||
|
|
||
| var details = emf.RecordsToString(); |
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.
This is how you get an idea of the records involved. Once you PrintToMetafile(emf) call emf.RecordsToString() to dump it out in the debugger.
Codecov Report
@@ Coverage Diff @@
## master #3774 +/- ##
====================================================
- Coverage 67.39429% 36.20164% -31.19265%
====================================================
Files 1393 916 -477
Lines 504657 250403 -254254
Branches 40895 36662 -4233
====================================================
- Hits 340110 90650 -249460
+ Misses 158716 154636 -4080
+ Partials 5831 5117 -714
Flags with carried forward coverage won't be shown. Click here to find out more. |
|
|
||
| public bool IsStockObject => (index & 0x80000000) != 0; | ||
| public Gdi32.StockObject StockObject => (Gdi32.StockObject)index; | ||
| public Gdi32.StockObject StockObject => (Gdi32.StockObject)(index & ~0x80000000); |
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.
I had a comment about distinction between "regular" stock objects to EMF stock objects, but it looks like it did not get saved...
Because your explanation about the high order 1 in EMF stock objects is in a different file, this code will be more readable if you qualify what kind of stock object it is.
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.
I'll add some comments in master clarifying that EMF takes the twos complement to smuggle stock object identifiers.
Stock objects have a different define in metafile records. Correct values for API usage. Add rectangle validation to the EMF validator and add regression tests for button and the Interop definitions.
Stock objects have a different define in metafile records. Correct values for API usage.
Add rectangle validation to the EMF validator and add regression tests for button and the Interop definitions.
Fixes #3770
Customer Impact
Regression?
Risk
Microsoft Reviewers: Open in CodeFlow