Skip to content

Match the Windows pixel magnifier on Linux - #12

Merged
DevanMetz merged 3 commits into
mainfrom
grok/pixel-magnifier
Oct 28, 2026
Merged

DevanMetz merged 3 commits into
mainfrom
grok/pixel-magnifier

Conversation

@DevanMetz

Copy link
Copy Markdown
Owner

What changed

The Linux snip magnifier matches the Windows loupe.

  • A 15×15 grid shows the frozen frame, one cell per pixel, scaled without blending.
  • The center cell stays on the cursor pixel, including at the edge of the frame.
  • The strip under the grid shows a swatch and #RRGGBB with that pixel's coordinate.
  • PARITY.md lists every Windows feature against this branch.

Windows behavior is unchanged.

Why

The Linux loupe stretched a filtered patch of the screen, so neighboring pixels blended, and the crosshair slid off the real pixel once the cursor reached the edge. Windows shows the pixels themselves and the color.

The window-grab PR adds a hex label on the old scaled loupe and rewrites DrawMagnifier. This branch replaces that loupe. When both merge, keep the grid and keep the window-hit code from that PR.

How it was tested

  • dotnet test tests/OpenSnip.Tests/OpenSnip.Tests.csproj -c Release — 15 passed. The tests check the center cell, the edge (the center does not slide), the #RRGGBB label, placement, and that a scaled cell stays a solid block.
  • dotnet build src/OpenSnip.csproj -c Release -p:EnableWindowsTargeting=true — succeeded, 0 warnings. src/ is unchanged.
  • On X11 (DISPLAY=:1, 1920×1200): a one-pixel red dot in a blue window. With the pointer on that dot, the loupe showed an 8×8 block of pure red (the center cell inside its outline) and a pure blue cell on the diagonal. 164 pure-red pixels, the red interior plus the 10×10 swatch.

The loupe scaled a filtered patch and slid off the cursor pixel at the edge of the frame. It now draws a 15 by 15 nearest-neighbor grid, keeps the center cell on that pixel, and shows the color.
# Conflicts:
#	.github/workflows/build.yml
#	PARITY.md
#	README.md
#	linux/OverlayWindow.cs
@DevanMetz
DevanMetz merged commit a3dced0 into main Oct 28, 2026
2 checks passed
@DevanMetz
DevanMetz deleted the grok/pixel-magnifier branch October 28, 2026 00:42
@DevanMetz DevanMetz mentioned this pull request Oct 28, 2026
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.

1 participant