Change: Scale thickness of slider bevel.

pull/461/head
Peter Nelson 2 years ago committed by PeterN
parent 1180c95372
commit 64a1fc174f

@ -31,6 +31,7 @@ void DrawSliderWidget(Rect r, int min_value, int max_value, int value)
/* Draw a wedge indicating low to high value. */
const int ha = (r.bottom - r.top) / 5;
const int t = WidgetDimensions::scaled.bevel.top; /* Thickness of lines */
int wx1 = r.left, wx2 = r.right;
if (_current_text_dir == TD_RTL) std::swap(wx1, wx2);
const uint shadow = _colour_gradient[COLOUR_GREY][3];
@ -38,9 +39,9 @@ void DrawSliderWidget(Rect r, int min_value, int max_value, int value)
const uint light = _colour_gradient[COLOUR_GREY][7];
const std::vector<Point> wedge{ Point{wx1, r.bottom - ha}, Point{wx2, r.top + ha}, Point{wx2, r.bottom - ha} };
GfxFillPolygon(wedge, fill);
GfxDrawLine(wedge[0].x, wedge[0].y, wedge[2].x, wedge[2].y, light);
GfxDrawLine(wedge[1].x, wedge[1].y, wedge[2].x, wedge[2].y, _current_text_dir == TD_RTL ? shadow : light);
GfxDrawLine(wedge[0].x, wedge[0].y, wedge[1].x, wedge[1].y, shadow);
GfxDrawLine(wedge[0].x, wedge[0].y, wedge[2].x, wedge[2].y, light, t);
GfxDrawLine(wedge[1].x, wedge[1].y, wedge[2].x, wedge[2].y, _current_text_dir == TD_RTL ? shadow : light, t);
GfxDrawLine(wedge[0].x, wedge[0].y, wedge[1].x, wedge[1].y, shadow, t);
/* Draw a slider handle indicating current value. */
const int sw = ScaleGUITrad(SLIDER_WIDTH);

Loading…
Cancel
Save