Fix #10164: Incorrect slider handle position in RTL. (#10175)

This commit is contained in:
PeterN 2022-11-16 19:02:51 +00:00 committed by GitHub
parent bc5cd4eeda
commit 6ea3e7e487
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -63,8 +63,9 @@ void DrawSliderWidget(Rect r, int min_value, int max_value, int value, const std
}
/* Draw a slider handle indicating current value. */
value -= min_value;
if (_current_text_dir == TD_RTL) value = max_value - value;
x = r.left + ((value - min_value) * (r.right - r.left - sw) / max_value);
x = r.left + (value * (r.right - r.left - sw) / max_value);
DrawFrameRect(x, r.top, x + sw, r.bottom, COLOUR_GREY, FR_NONE);
}