improve slider

This commit is contained in:
lixianjing 2021-07-20 17:28:09 +08:00
parent 9a43d95119
commit 1dd7f5c331

View File

@ -284,7 +284,7 @@ static ret_t slider_on_event(widget_t* widget, event_t* e) {
double range = slider->max - slider->min;
if (slider->vertical) {
value = range * p.y / (widget->h - dr->h);
value = range - range * p.y / (widget->h - dr->h);
} else {
value = range * p.x / (widget->w - dr->w);
}