Repository navigation
Fix: Dimensions tool: Aspect ratio icons look blurry next to the Original icon - #86344
Conversation
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the aspect-ratio icon update.
No open issues 🎉
What changed in this PR
Addresses #86297 by sharpening the aspect ratio icons in Gutenberg’s Dimensions tool on 2× displays.
Changes:
- Snaps rectangle edges to quarter-pixel positions and mirrors opposite edges to keep icons centered.
- Adds a block-editor changelog entry for the visual fix.
| File | Description |
|---|---|
packages/block-editor/src/components/dimensions-tool/aspect-ratio-icon.tsx |
Adds pixel snapping for sharper, centered icon outlines. |
packages/block-editor/CHANGELOG.md |
Documents the aspect ratio icon fix. |
Review effort: Balanced
mirka
left a comment
There was a problem hiding this comment.
Just some small ideas for simplification.


What?
Closes #86297
The ratio icons in the Aspect ratio dropdown now have sharp outlines, like the Original icon next to them. This follows up on #85812, as suggested in this review comment.
Why?
Each icon's edges are worked out from its ratio, and they often land on whole numbers, halves or thirds. The 1.5px line centred on those edges then covers only part of a pixel on each side, so the browser blurs it. The generic aspect ratio icon puts its edges at .25 and .75, so its line covers whole pixels on a 2x display.
How?
snapToPixels()helper that moves an edge to the nearest .25 or .75.shape-rendering="crispEdges"would also remove the blur, but it makes the rounded corners jagged, so it's not being used.Testing Instructions
AspectRatioToolstoriesWithOptionsandCustomRatio.Screenshots or screencast
Use of AI Tools
I used Claude Code (Claude Opus 5.5) to trace the cause and draft the fix and this description. I reviewed and tested the changes myself.