Skip to content

Use traitCollection.displayScale for display scale in view code#25690

Closed
crazytonyli wants to merge 1 commit into
trunkfrom
task/uiscreen-view-displayscale
Closed

Use traitCollection.displayScale for display scale in view code#25690
crazytonyli wants to merge 1 commit into
trunkfrom
task/uiscreen-view-displayscale

Conversation

@crazytonyli

Copy link
Copy Markdown
Contributor

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.

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.
@crazytonyli crazytonyli added this to the 27.1 milestone Jun 24, 2026
@crazytonyli crazytonyli requested a review from jkmassel June 24, 2026 01:58
@crazytonyli crazytonyli enabled auto-merge June 24, 2026 01:58
@dangermattic

Copy link
Copy Markdown
Collaborator
1 Warning
⚠️ View files have been modified, but no screenshot or video is included in the pull request. Consider adding some for clarity.

Generated by 🚫 Danger

@wpmobilebot

Copy link
Copy Markdown
Contributor
App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number32771
VersionPR #25690
Bundle IDorg.wordpress.alpha
Commit1011259
Installation URL6h9c4jun6jks0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

Copy link
Copy Markdown
Contributor
App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number32771
VersionPR #25690
Bundle IDcom.jetpack.alpha
Commit1011259
Installation URL3jbfctllpood8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@jkmassel jkmassel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

traitCollection.displayScale can be 0 before the view is attached, right?

I feel like that might cause some issues

@crazytonyli

Copy link
Copy Markdown
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants