Skip to content

fix calculation of the height and width as per viewport (for play-only-mode)#4495

Closed
apsinghdev wants to merge 1 commit intosugarlabs:masterfrom
apsinghdev:fix/dpr
Closed

fix calculation of the height and width as per viewport (for play-only-mode)#4495
apsinghdev wants to merge 1 commit intosugarlabs:masterfrom
apsinghdev:fix/dpr

Conversation

@apsinghdev
Copy link
Copy Markdown
Contributor

fixes: #4493

I believe this is more of a DPR issue because modern devices (like the iPhone XR) have high-resolution screens. The iPhone XR, for example, has a DPR of 2. This means:

The actual screen resolution is 828 x 1792 pixels (logical resolution × DPR).

The logical resolution (CSS pixels) is 414 x 896 pixels.

Screenshot 2025-03-05 at 12 22 16 PM Here you can see the values of the innerHeight and innerWidth are twice of the actual values. Screenshot 2025-03-05 at 12 45 41 PM

The issue is the environment we are testing in. If you check the same code on an actual phone or device with a defined height and width, this issue will not arise. Browsers can simulate the width and height of the phone screens but don't match their respective DPR.

@walterbender Please take a look.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 5, 2025

✅ All Jest tests passed! This PR is ready to merge.

@walterbender
Copy link
Copy Markdown
Member

The question is, at what point do we want to transition. It looks to me like the emulated iPhone image you are sharing has sufficient resolution to work with, although not necessarily a pleasant experience.

@justin212407
Copy link
Copy Markdown
Member

The transition point i kept in my PR initially was of a screen width of 759px. Also i have tried using the meta tag in my draft PR itself for the same and this approach does not exactly work.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented May 8, 2025

This pull request has been open for more than 60 days without any activity. It will be closed in 3 days unless the stale label is removed or commented on.

@github-actions github-actions bot added the Stale label May 8, 2025
@github-actions
Copy link
Copy Markdown
Contributor

Closed pull request due to inactivity for more than 63 days.

@github-actions github-actions bot closed this May 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Play-Only-Mode not rendering

3 participants