1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2025-03-23 10:29:18 +00:00

round viewport width on android

This commit is contained in:
Alula 2022-02-12 08:57:06 +01:00
parent c4f1c60e35
commit c82c65c39f
No known key found for this signature in database
GPG key ID: 3E00485503A1D8BA

View file

@ -130,7 +130,7 @@ fn get_insets() -> GameResult<(f32, f32, f32, f32)> {
fn get_scaled_size(width: u32, height: u32) -> (f32, f32) {
let scaled_height = ((height / 480).max(1) * 480) as f32;
let scaled_width = width as f32 * (scaled_height as f32 / height as f32);
let scaled_width = (width as f32 * (scaled_height as f32 / height as f32)).floor();
(scaled_width, scaled_height)
}