Repository navigation
Render the Omarchy logo sharply at fractional scales - #69
Open
nchudleigh wants to merge 3 commits into
Open
nchudleigh wants to merge 3 commits into
nchudleigh wants to merge 3 commits into
Conversation
At 1.5x scale the logo glyph rendered 27 device pixels wide, off the 15 px grid it is drawn on, so its 1 px strokes straddled pixels and blurred. Snap its size to the nearest multiple of 15 device pixels (window.devicePixelRatio, since Screen.devicePixelRatio reports 1 in layer windows) and render it natively so FreeType hints the strokes onto that grid. Measured on a 1.5x monitor, half-tone pixels in the logo fell from 35% to 17%. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Same as the search bar logo: 11 px became 16.5 device pixels at 1.5x, off the glyph's 15 px grid. Snap it and hint it; toast icons keep their size. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Qt draws the first frame after the surface maps at scale 1, before the output's fractional scale arrives. That frame was shown stretched and soft, with scale-dependent sizes (the snapped logos) visibly jumping as the real scale landed. Hold the content transparent until the surface has the output's size and scale, as Omarchy's OverlayWindow does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
At fractional scales the Omarchy logo in the search bar and footer looks blurred. The glyph is drawn on a 15 px grid. At 1.5x the search-bar logo comes out 27 device pixels wide and the footer logo 16.5, so its 1 px strokes straddle device pixels.
Change
crispLogoSize()snaps the logo to the nearest multiple of 15 device pixels. It readswindow.devicePixelRatio, becauseScreen.devicePixelRatioreports 1 in layer windows. At 1.5x the search-bar logo goes from 27 to 30 device pixels and the footer logo from 16.5 to 15.Text.NativeRendering, as Omarchy's bar glyphs do, so FreeType hints the strokes onto that grid. Toast icons in the footer keep their size and rendering.Measured on a 1.5x monitor, half-tone pixels in the search-bar logo fell from 35% to 17%.
Ui/OverlayWindowdoes (omacast can't use that component because Omarchy 4.0.x doesn't ship it). Qt sometimes draws the first frame after mapping at scale 1. Before, that frame showed stretched, and the snapped logos visibly jumped when the real scale landed. Opacity keeps keyboard handling live during that frame.Testing
node --test tests/*.test.jspasses. Checked live at 1.5x (screenshots below). Variable-frame-rate recordings across 8 opens show no stretched first frame; before, one appeared within 3 opens.Screenshots
Search bar, before | after (4x, nearest neighbour):
Footer, before (top) | after (bottom):
🤖 Generated with Claude Code