Fix T38383: glitch drawing inactive slider
This commit is contained in:
@@ -2663,6 +2663,7 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s
|
|||||||
|
|
||||||
/* draw left/right parts only when not in text editing */
|
/* draw left/right parts only when not in text editing */
|
||||||
if (!(state & UI_TEXTINPUT)) {
|
if (!(state & UI_TEXTINPUT)) {
|
||||||
|
int roundboxalign_slider;
|
||||||
|
|
||||||
/* slider part */
|
/* slider part */
|
||||||
copy_v3_v3_char(outline, wcol->outline);
|
copy_v3_v3_char(outline, wcol->outline);
|
||||||
@@ -2687,11 +2688,15 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s
|
|||||||
rect1.xmax = rect1.xmin + fac + offs;
|
rect1.xmax = rect1.xmin + fac + offs;
|
||||||
rect1.xmin += floor(offs - U.pixelsize);
|
rect1.xmin += floor(offs - U.pixelsize);
|
||||||
|
|
||||||
if (rect1.xmax + offs > rect->xmax)
|
if (rect1.xmax + offs > rect->xmax) {
|
||||||
|
roundboxalign_slider = roundboxalign & ~(UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT);
|
||||||
offs *= (rect1.xmax + offs - rect->xmax) / offs;
|
offs *= (rect1.xmax + offs - rect->xmax) / offs;
|
||||||
else
|
}
|
||||||
|
else {
|
||||||
|
roundboxalign_slider = 0;
|
||||||
offs = 0.0f;
|
offs = 0.0f;
|
||||||
round_box_edges(&wtb1, roundboxalign & ~(UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT), &rect1, offs);
|
}
|
||||||
|
round_box_edges(&wtb1, roundboxalign_slider, &rect1, offs);
|
||||||
|
|
||||||
widgetbase_draw(&wtb1, wcol);
|
widgetbase_draw(&wtb1, wcol);
|
||||||
copy_v3_v3_char(wcol->outline, outline);
|
copy_v3_v3_char(wcol->outline, outline);
|
||||||
|
Reference in New Issue
Block a user