-
Notifications
You must be signed in to change notification settings - Fork 998
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
Recalculate the node position of the TreeView when DrawMode = TreeViewDrawMode.OwnerDrawText #12698
base: main
Are you sure you want to change the base?
Recalculate the node position of the TreeView when DrawMode = TreeViewDrawMode.OwnerDrawText #12698
Conversation
…wDrawMode.OwnerDrawText
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12698 +/- ##
===================================================
+ Coverage 76.02967% 76.13939% +0.10972%
===================================================
Files 3181 3189 +8
Lines 639670 640126 +456
Branches 47215 47239 +24
===================================================
+ Hits 486339 487388 +1049
+ Misses 149819 149211 -608
- Partials 3512 3527 +15
Flags with carried forward coverage won't be shown. Click here to find out more. |
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.
Had you tested this change at different scaling factors and in different level nodes in a tree view? For example 3rd level child?
It will be helpful to add code comments that describe what the constants are for.
Fixes #12681
Root Cause
When
treeView.DrawMode = TreeViewDrawMode.OwnerDrawText
, the node'sFillRectangle
andFocusRectangle
positions are calculated incorrectlyProposed changes
CustomDraw
of the TreeView.cs, WhenRightToLeft == RightToLeft.Yes && RightToLeftLayout
reverses the X drawing coordinates ofFillRectangle
andFocusRectangle
Customer Impact
Regression?
Risk
Screenshots
Before
After
When setting RightToLeft = Yes, RightToLeftLayout = True and .DrawMode = TreeViewDrawMode.OwnerDrawText, the selected node box is fully rendered
Test methodology
Test environment(s)
Microsoft Reviewers: Open in CodeFlow