Skip to content

Optimize icon rendering: simplify logic and eliminate redundant calculations #13449

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DJm00n
Copy link
Contributor

@DJm00n DJm00n commented May 13, 2025

  • Replaced HDC with Graphics in DrawIcon() for smoother GDI+ integration
  • Optimized Rectangle management – removed unnecessary variables, directly adjusting sizes
  • Simplified stretch logic (Inflate) – replaced complex calculations with a concise method call
  • Unified Draw() and DrawUnstretched() – now both directly call DrawIcon() without intermediate processing
  • Eliminated duplicate Matrix.Offset calculations, ensuring targetRect is adjusted directly
  • No functional changes, just cleaner, more maintainable code 🚀

Regression?

  • No
Microsoft Reviewers: Open in CodeFlow

…lations

- Replaced HDC with Graphics in DrawIcon() for smoother GDI+ integration
- Optimized Rectangle management – removed unnecessary variables, directly adjusting sizes
- Simplified stretch logic (Inflate) – replaced complex calculations with a concise method call
- Unified Draw() and DrawUnstretched() – now both directly call DrawIcon() without intermediate processing
- Eliminated duplicate Matrix.Offset calculations, ensuring targetRect is adjusted directly
- No functional changes, just cleaner, more maintainable code 🚀
Copy link

codecov bot commented May 13, 2025

Codecov Report

Attention: Patch coverage is 73.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 76.60189%. Comparing base (5821493) to head (28c65ed).
Report is 1 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                  @@
##                main      #13449          +/-   ##
====================================================
+ Coverage   62.21083%   76.60189%   +14.39105%     
====================================================
  Files           3213        3230          +17     
  Lines         638302      639043         +741     
  Branches       47201       47287          +86     
====================================================
+ Hits          397093      489519       +92426     
+ Misses        234153      145951       -88202     
+ Partials        7056        3573        -3483     
Flag Coverage Δ
Debug 76.60189% <73.33333%> (+14.39105%) ⬆️
integration 18.79058% <0.00000%> (+0.00179%) ⬆️
production 51.00214% <73.33333%> (+32.21335%) ⬆️
test 97.40411% <ø> (ø)
unit 48.40830% <73.33333%> (?)

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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant