microsoft / microsoft/PowerToys

[Screen Ruler] PixelsClose total-mode truncates diff via & 0xFF

Open Beginner friendly
#46,946 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue-Bug Product-Screen Ruler
Dominant language
C
Stars
139k
Forks
8.6k
PR merge metrics
PR metrics pending

Description

Bug

PixelsClose<false> in BGRATextureView.h masks SAD result with & 0xFF. Total diff >255 wraps around (765→253), making very-different pixels appear close.
Fix: Use & 0xFFFF or remove mask.
Found by AI test review fleet

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open BGRATextureView.h and locate PixelsClose, then trace how the total SAD value is masked. Verify the fix with a total difference above 255, such as 765, and confirm that very different pixels are no longer treated as close.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
desktop
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
85/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.