[MPlayer-cvslog] r36378 - in trunk/gui: dialog/preferences.c interface.c

ib subversion at mplayerhq.hu
Tue Jul 30 15:07:43 CEST 2013


Author: ib
Date: Tue Jul 30 15:07:43 2013
New Revision: 36378

Log:
Increase precision of calculation by using constants of type double.

Additionally: Rearrange calculation for clarity and add comments.

Modified:
   trunk/gui/dialog/preferences.c
   trunk/gui/interface.c

Modified: trunk/gui/dialog/preferences.c
==============================================================================
--- trunk/gui/dialog/preferences.c	Tue Jul 30 14:31:49 2013	(r36377)
+++ trunk/gui/dialog/preferences.c	Tue Jul 30 15:07:43 2013	(r36378)
@@ -1203,8 +1203,8 @@ void ShowPreferences( void )
 #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 )

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Tue Jul 30 14:31:49 2013	(r36377)
+++ trunk/gui/interface.c	Tue Jul 30 15:07:43 2013	(r36378)
@@ -936,12 +936,12 @@ void mplayer(int what, float value, void
         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;
 


More information about the MPlayer-cvslog mailing list