Use traitCollection.displayScale for display scale in view code#25690
Closed
crazytonyli wants to merge 1 commit into
Closed
Use traitCollection.displayScale for display scale in view code#25690crazytonyli wants to merge 1 commit into
crazytonyli wants to merge 1 commit into
Conversation
Replace UIScreen.main.scale with the local view or view controller's traitCollection.displayScale across cells, image-view extensions, and the editor so the display scale resolves from the rendering view's context rather than the deprecated shared main screen. The Gutenberg navigation bar's hairline border caches the scale in its frame, so it now refreshes through registerForTraitChanges to stay correct across display changes.
Collaborator
Generated by 🚫 Danger |
Contributor
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 32771 | |
| Version | PR #25690 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 1011259 | |
| Installation URL | 6h9c4jun6jks0 |
Contributor
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 32771 | |
| Version | PR #25690 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 1011259 | |
| Installation URL | 3jbfctllpood8 |
jkmassel
requested changes
Jun 24, 2026
jkmassel
left a comment
Contributor
There was a problem hiding this comment.
traitCollection.displayScale can be 0 before the view is attached, right?
I feel like that might cause some issues
Contributor
Author
|
Good catch! I'll look at the changes more carefully and split this PR into smaller PRs. |
auto-merge was automatically disabled
June 24, 2026 09:06
Pull request was closed
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.


Replace UIScreen.main.scale with the local view or view controller's traitCollection.displayScale
I did not bother capturing screenshots because the changes all seem pretty reasonable and low risk.