Touchscreen: make volume bars respect volume step increment

Change-Id: I449b305ec4070e61f3619f8b7ac01a74c3ac59a6
This commit is contained in:
Aidan MacDonald 2021-06-16 13:51:09 +01:00
parent b5c40d9991
commit 8a6b2f3abc

View file

@ -190,8 +190,10 @@ static int skintouch_to_wps(struct wps_data *data)
{ {
const int min_vol = sound_min(SOUND_VOLUME); const int min_vol = sound_min(SOUND_VOLUME);
const int max_vol = sound_max(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 = (offset * (max_vol - min_vol)) / 100;
global_settings.volume += min_vol; global_settings.volume += min_vol;
global_settings.volume -= (global_settings.volume % step_vol);
setvol(); setvol();
} }
return ACTION_TOUCHSCREEN; return ACTION_TOUCHSCREEN;