diff --git a/apps/gui/skin_engine/skin_touchsupport.c b/apps/gui/skin_engine/skin_touchsupport.c index 7a03e83c36..b92fd1e83e 100644 --- a/apps/gui/skin_engine/skin_touchsupport.c +++ b/apps/gui/skin_engine/skin_touchsupport.c @@ -109,12 +109,21 @@ int skin_get_touchaction(struct wps_data *data, int* edge_offset, { struct progressbar *bar = SKINOFFSETTOPTR(skin_buffer, r->bar); - if(r->width > r->height) - *edge_offset = vx*100/r->width; - else /* vertical bars are bottom-up by default */ - *edge_offset = 100 - vy*100/r->height; + if(r->width > r->height) { + if(r->width > 1) + *edge_offset = vx*1000/(r->width - 1); + else + *edge_offset = 0; + } else { + /* vertical bars are bottom-up by default */ + if(r->height > 1) + *edge_offset = 1000 - vy*1000/(r->height - 1); + else + *edge_offset = 0; + } + if (r->reverse_bar || (bar && bar->invert_fill_direction)) - *edge_offset = 100 - *edge_offset; + *edge_offset = 1000 - *edge_offset; } temp = r; returncode = r->action; @@ -294,7 +303,7 @@ int skin_get_touchaction(struct wps_data *data, int* edge_offset, { int val, count; get_setting_info_for_bar(bar->setting_id, &count, &val); - val = *edge_offset * count / 100; + val = *edge_offset * count / 1000; update_setting_value_from_touch(bar->setting_id, val); } } diff --git a/apps/gui/wps.c b/apps/gui/wps.c index 2c668998f0..35716087c2 100644 --- a/apps/gui/wps.c +++ b/apps/gui/wps.c @@ -182,7 +182,7 @@ static int skintouch_to_wps(struct wps_data *data) return ACTION_WPS_HOTKEY; #endif case ACTION_TOUCH_SCROLLBAR: - skin_get_global_state()->id3->elapsed = skin_get_global_state()->id3->length*offset/100; + skin_get_global_state()->id3->elapsed = skin_get_global_state()->id3->length*offset/1000; audio_pre_ff_rewind(); audio_ff_rewind(skin_get_global_state()->id3->elapsed); return ACTION_TOUCHSCREEN; @@ -191,7 +191,7 @@ 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 = (offset * (max_vol - min_vol)) / 1000; global_settings.volume += min_vol; global_settings.volume -= (global_settings.volume % step_vol); setvol();