From 6c5328f07362510a41c8518ced62d74b2eff25cc Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 5 Jun 2022 23:46:37 +0200 Subject: Make size_in_pixels() more accurate. --- src/subtitle_string.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/subtitle_string.cc') diff --git a/src/subtitle_string.cc b/src/subtitle_string.cc index 5e2c6251..e70a849f 100644 --- a/src/subtitle_string.cc +++ b/src/subtitle_string.cc @@ -90,7 +90,7 @@ SubtitleString::SubtitleString ( } -int +float SubtitleString::size_in_pixels (int screen_height) const { /* Size in the subtitle file is given in points as if the screen @@ -98,7 +98,7 @@ SubtitleString::size_in_pixels (int screen_height) const height. */ - return _size * screen_height / (11 * 72); + return _size * static_cast(screen_height) / (11.0f * 72.0f); } -- cgit v1.2.3