Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 24, 2025

Fixes #14167

Root Cause

Icons similar to HSplit.cur, VSplit.cur are wider than other icons at certain DPI settings (such as 125%, 175%, 225%, 250%), which is causing the webtable to display abnormally.

Proposed changes

  • Modify the drawing method for list items to use the default icon width as a reference, ensuring that all icons are the same size.

Customer Impact

  • Cursor editor items are displayed correctly in propertyGrid with all DPI settings.

Regression?

  • No

Risk

  • Minimal

Screenshots

Before

image

After

150DPI:

150DPI.mp4

175DPI:

175DPI.mp4

200DPI:

200DPI.mp4

225DPI:

225DPI.mp4

Test methodology

  • Manually

Test environment(s)

  • 11.0.0-alpha.1.25619.109
Microsoft Reviewers: Open in CodeFlow

Copilot AI and others added 4 commits December 24, 2025 09:45
Co-authored-by: SimonZhao888 <133954995+SimonZhao888@users.noreply.github.com>
…stency

Co-authored-by: SimonZhao888 <133954995+SimonZhao888@users.noreply.github.com>
Co-authored-by: SimonZhao888 <133954995+SimonZhao888@users.noreply.github.com>
Co-authored-by: SimonZhao888 <133954995+SimonZhao888@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix cursor editor display issues in propertyGrid for HDPI settings Fix cursor editor ItemHeight calculation for proper DPI scaling Dec 24, 2025
Copilot AI requested a review from SimonZhao888 December 24, 2025 09:53
@codecov
Copy link

codecov bot commented Dec 24, 2025

Codecov Report

❌ Patch coverage is 42.85714% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.15187%. Comparing base (05b7c2e) to head (580788c).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #14168         +/-   ##
===================================================
- Coverage   77.15877%   77.15187%   -0.00691%     
===================================================
  Files           3279        3279                 
  Lines         645333      645335          +2     
  Branches       47720       47720                 
===================================================
- Hits          497931      497888         -43     
- Misses        143719      143749         +30     
- Partials        3683        3698         +15     
Flag Coverage Δ
Debug 77.15187% <42.85714%> (-0.00691%) ⬇️
integration 18.97192% <0.00000%> (-0.03218%) ⬇️
production 52.01441% <42.85714%> (-0.01530%) ⬇️
test 97.40559% <ø> (ø)
unit 49.45494% <42.85714%> (+0.01250%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dotnet-policy-service dotnet-policy-service bot added the draft draft PR label Dec 24, 2025
@SimonZhao888 SimonZhao888 marked this pull request as ready for review December 26, 2025 05:43
@SimonZhao888 SimonZhao888 requested a review from a team as a code owner December 26, 2025 05:43
@dotnet-policy-service dotnet-policy-service bot removed the draft draft PR label Dec 26, 2025
@SimonZhao888 SimonZhao888 changed the title Fix cursor editor ItemHeight calculation for proper DPI scaling Fix cursor editor icon width calculation for proper DPI scaling Dec 26, 2025
@SimonZhao888
Copy link
Member

Here is another issue: when the DPI is set to 125%, 175%, 225%, 250%, the .cur icon exhibits an icon offset problem.
Normal:
image

Offset:
image

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a DPI scaling issue in the cursor editor where certain cursors (HSplit, VSplit) appeared wider than others at specific DPI settings (125%, 175%, 225%, 250%), causing display alignment issues in the PropertyGrid. The fix standardizes icon width by calculating it once using the default cursor as a reference, rather than computing individual widths for each cursor during drawing.

Key changes:

  • Introduces a _cursorWidth field calculated once in the constructor using Cursors.Default
  • Refactors OnDrawItem to use the pre-calculated width instead of computing it per cursor
  • Improves performance by eliminating repeated DPI scaling calculations during drawing

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.

[HDPI] Cursor editor some items are not displayed in propertyGrid with special DPI settings

4 participants