changeset 36282:872298702c15

Increase precision of calculation by using constants of type double. Additionally: Rearrange calculation for clarity and add comments.
author ib
date Tue, 30 Jul 2013 13:07:43 +0000
parents 4e64c5384bce
children ebbd9730a8c6
files gui/dialog/preferences.c gui/interface.c
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/gui/dialog/preferences.c	Tue Jul 30 12:31:49 2013 +0000
+++ b/gui/dialog/preferences.c	Tue Jul 30 13:07:43 2013 +0000
@@ -1203,8 +1203,8 @@
 #ifndef CONFIG_FREETYPE
  gtk_adjustment_set_value( HSFontFactoradj,font_factor );
 #else
- gtk_adjustment_set_value( HSFontBluradj,( subtitle_font_radius / 8.0f ) * 100.0f );
- gtk_adjustment_set_value( HSFontOutLineadj,( subtitle_font_thickness / 8.0f ) * 100.0f );
+ gtk_adjustment_set_value( HSFontBluradj,subtitle_font_radius / 8.0 * 100.0);         // transform 0..8 to 0..100
+ gtk_adjustment_set_value( HSFontOutLineadj,subtitle_font_thickness / 8.0 * 100.0);   // transform 0..8 to 0..100
  gtk_adjustment_set_value( HSFontTextScaleadj,text_font_scale_factor );
  gtk_adjustment_set_value( HSFontOSDScaleadj,osd_font_scale_factor );
  if ( subtitle_font_encoding )
--- a/gui/interface.c	Tue Jul 30 12:31:49 2013 +0000
+++ b/gui/interface.c	Tue Jul 30 13:07:43 2013 +0000
@@ -936,12 +936,12 @@
         break;
 
     case MPLAYER_SET_FONT_OUTLINE:
-        subtitle_font_thickness = (8.0f / 100.0f) * value;
+        subtitle_font_thickness = 8.0 * value / 100.0;   // transform 0..100 to 0..8
         mplayerLoadFont();
         break;
 
     case MPLAYER_SET_FONT_BLUR:
-        subtitle_font_radius = (8.0f / 100.0f) * value;
+        subtitle_font_radius = 8.0 * value / 100.0;      // transform 0..100 to 0..8
         mplayerLoadFont();
         break;