Skip to content
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

Fix basic AppKitBackend layout test in CI #112

Merged
merged 3 commits into from
Mar 10, 2025
Merged

Fix basic AppKitBackend layout test in CI #112

merged 3 commits into from
Mar 10, 2025

Conversation

stackotter
Copy link
Owner

After debugging the CI, I discovered that the CI renders at 1x scale instead of 2x scale (retina). This causes the text to get kerned differently and ends up changing the layout in ways that can't be adjusted for by just dividing by two.

This PR is based off ideas from pointfreeco/swift-snapshot-testing#533

The fix was to override the backingScaleFactor of NSWindow to 1.0 from a subclass. I also overrode the color space while I was at it just in case.

@stackotter stackotter merged commit 9313474 into main Mar 10, 2025
8 checks passed
@stackotter stackotter deleted the ui_testing branch March 10, 2025 01:08
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