[retro-gtk] core: Fix computation of the aspect ratio
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [retro-gtk] core: Fix computation of the aspect ratio
- Date: Wed, 22 Feb 2017 22:29:10 +0000 (UTC)
commit 4740f42556a32d63e931a0aa7090600e7c42757c
Author: Adrien Plazas <kekun plazas laposte net>
Date: Wed Feb 22 23:25:45 2017 +0100
core: Fix computation of the aspect ratio
Perform a float division instead of an integer division when computing
the aspect ratio.
retro-gtk/retro-environment.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/retro-gtk/retro-environment.c b/retro-gtk/retro-environment.c
index 7f13a24..40099f6 100644
--- a/retro-gtk/retro-environment.c
+++ b/retro-gtk/retro-environment.c
@@ -432,7 +432,7 @@ void retro_core_set_system_av_info (RetroCore *self, RetroSystemAvInfo *system_a
if (system_av_info->geometry.aspect_ratio > 0.f)
self->aspect_ratio = system_av_info->geometry.aspect_ratio;
else
- self->aspect_ratio = system_av_info->geometry.base_width /
system_av_info->geometry.base_height;
+ self->aspect_ratio = (float) system_av_info->geometry.base_width / (float)
system_av_info->geometry.base_height;
self->sample_rate = system_av_info->timing.sample_rate;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]