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

Allow scaling of the presplash image to device resolution #481

Closed
fabiankreutz opened this issue Oct 27, 2015 · 3 comments
Closed

Allow scaling of the presplash image to device resolution #481

fabiankreutz opened this issue Oct 27, 2015 · 3 comments

Comments

@fabiankreutz
Copy link

The presplash image is not scaled to fullscreen and no configuration option allows anything but the default behaviour.
The code resides currently in SDLSurfaceView.java and a diff that (fixed) scales the image while keeping the ratio is

815,816c816,823
<             float mx = ((float)mWidth / bitmap.getWidth()) / 2.0f;
<             float my = ((float)mHeight / bitmap.getHeight()) / 2.0f;

---
>             float mx, my;
>             if (bitmap.getWidth() < bitmap.getHeight()) {
>                 mx = 0.5f;
>                 my = (float)bitmap.getHeight() / bitmap.getWidth() / 2.0f;
>             } else {
>                 mx = (float)bitmap.getWidth() / bitmap.getHeight() / 2.0f;
>                 my = 0.5f;
>             }
@inclement
Copy link
Member

Nice fix. If you (or anyone else) would like to contribue it to p4a, feel free to make a pull request - it would be ideal to combine it with a command line option controlling which mode (pixel perfect or scaled) is used.

@fabiankreutz
Copy link
Author

So this issue can be closed, right?

@inclement
Copy link
Member

Yes, I just didn't get to it.

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

No branches or pull requests

2 participants