[vlc-commits] hotkeys: change text scale increments (refs #21432)
Francois Cartegnie
git at videolan.org
Thu Nov 8 14:06:21 CET 2018
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Nov 8 14:05:13 2018 +0100| [d20f77eb385ed837079d710b08f49cf788558b85] | committer: Francois Cartegnie
hotkeys: change text scale increments (refs #21432)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d20f77eb385ed837079d710b08f49cf788558b85
---
modules/control/hotkeys.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
index c1cd021a78..8ff5f114b4 100644
--- a/modules/control/hotkeys.c
+++ b/modules/control/hotkeys.c
@@ -1396,7 +1396,9 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
else
{
i_scale = var_GetInteger( p_playlist, "sub-text-scale" );
- i_scale += ((i_action == ACTIONID_SUBTITLE_TEXT_SCALE_UP) ? 1 : -1) * 25;
+ unsigned increment = ((i_scale > 100 ? i_scale - 100 : 100 - i_scale) / 25) <= 1 ? 10 : 25;
+ i_scale += ((i_action == ACTIONID_SUBTITLE_TEXT_SCALE_UP) ? 1 : -1) * increment;
+ i_scale -= i_scale % increment;
i_scale = VLC_CLIP( i_scale, 25, 500 );
}
var_SetInteger( p_playlist, "sub-text-scale", i_scale );
More information about the vlc-commits
mailing list