From 8a6b2f3abc4ec3d6417cb3dc3a6040c977a6036a Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Wed, 16 Jun 2021 13:51:09 +0100 Subject: [PATCH] Touchscreen: make volume bars respect volume step increment Change-Id: I449b305ec4070e61f3619f8b7ac01a74c3ac59a6 --- apps/gui/wps.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/gui/wps.c b/apps/gui/wps.c index b42e386a91..2c668998f0 100644 --- a/apps/gui/wps.c +++ b/apps/gui/wps.c @@ -190,8 +190,10 @@ static int skintouch_to_wps(struct wps_data *data) { const int min_vol = sound_min(SOUND_VOLUME); const int max_vol = sound_max(SOUND_VOLUME); + const int step_vol = sound_steps(SOUND_VOLUME); global_settings.volume = (offset * (max_vol - min_vol)) / 100; global_settings.volume += min_vol; + global_settings.volume -= (global_settings.volume % step_vol); setvol(); } return ACTION_TOUCHSCREEN;