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

pull/461/head
PeterN 2 years ago committed by GitHub
parent bc5cd4eeda
commit 6ea3e7e487
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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);
}

Loading…
Cancel
Save