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

Add API to query display corner radius. #2101

Open
MikuAuahDark opened this issue Sep 9, 2024 · 3 comments
Open

Add API to query display corner radius. #2101

MikuAuahDark opened this issue Sep 9, 2024 · 3 comments
Labels
Android feature New feature or request iOS

Comments

@MikuAuahDark
Copy link
Contributor

MikuAuahDark commented Sep 9, 2024

Mobile devices tend to have rounded corners on their display. Without taking this into account, it's possible that user elements are not visible, even when using love.window.getSafeArea.

Android 12 have this API and explanation: https://developer.android.com/develop/ui/views/layout/insets/rounded-corners

I believe iOS has something similar?

@MikuAuahDark MikuAuahDark added feature New feature or request Android iOS labels Sep 9, 2024
@slime73
Copy link
Member

slime73 commented Sep 14, 2024

I believe iOS has something similar?

I'm actually not sure it does, I can't find any API at least. Maybe it's already part of the safe area there?

@MikuAuahDark
Copy link
Contributor Author

MikuAuahDark commented Sep 15, 2024

Hmm, that's interesting. I wonder what this looks like in iPhone with rounded corners?

function love.draw()
	love.graphics.setColor(1, 0, 0)
	love.graphics.rectangle("fill", 0, 0, love.graphics.getDimensions())
	love.graphics.setColor(0, 1, 0)
	love.graphics.rectangle("fill", love.window.getSafeArea())
end

If iOS handles rounded corners but Android doesn't, then it's an issue with Android and I should fix it.

@slime73
Copy link
Member

slime73 commented Oct 22, 2024

Here's what an iPhone looks like in portrait and landscape (using slightly modified code):

Screenshot 2024-10-21 at 9 08 40 PM Screenshot 2024-10-21 at 9 08 48 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android feature New feature or request iOS
Projects
None yet
Development

No branches or pull requests

2 participants