Fix T38383: glitch drawing inactive slider

This commit is contained in:
Campbell Barton 2014-01-29 04:10:39 +11:00
parent d34d7451a9
commit abf18033f3

@ -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 */
if (!(state & UI_TEXTINPUT)) {
int roundboxalign_slider;
/* slider part */
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.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;
else
}
else {
roundboxalign_slider = 0;
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);
copy_v3_v3_char(wcol->outline, outline);