[vlc-commits] hotkeys: change text scale increments (refs #21432)

Francois Cartegnie git at videolan.org
Thu Nov 8 15:18:28 CET 2018


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Nov  8 14:05:13 2018 +0100| [188fc7fa9799c5faef6027b50c6fa4f45cb310a2] | committer: Jean-Baptiste Kempf

hotkeys: change text scale increments (refs #21432)

(cherry picked from commit d20f77eb385ed837079d710b08f49cf788558b85)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=188fc7fa9799c5faef6027b50c6fa4f45cb310a2
---

 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 7daaf94bc9..91ebde82c1 100644
--- a/modules/control/hotkeys.c
+++ b/modules/control/hotkeys.c
@@ -1347,7 +1347,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