Fix T64463: Visual Artifacts with ColorRamp

This patch fixes an issue with the ColorRamp overflowing its drawing bounds

Differential Revision: https://developer.blender.org/D4843

Reviewed by Brecht Van Lommel
This commit is contained in:
2019-05-12 15:21:43 -07:00
parent 6d89693222
commit eff273c0bc
4 changed files with 7 additions and 4 deletions

View File

@@ -1599,8 +1599,8 @@ void ui_draw_but_COLORBAND(uiBut *but, const uiWidgetColors *UNUSED(wcol), const
return;
}
float x1 = rect->xmin + (0.25f * UI_UNIT_X);
float sizex = rect->xmax - x1 - (0.30f * UI_UNIT_X);
float x1 = rect->xmin;
float sizex = rect->xmax - x1;
float sizey = BLI_rcti_size_y(rect);
float sizey_solid = sizey * 0.25f;
float y1 = rect->ymin;

View File

@@ -4645,6 +4645,9 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct
break;
case UI_BTYPE_COLORBAND:
/* do not draw right to edge of rect */
rect->xmin += (0.25f * UI_UNIT_X);
rect->xmax -= (0.3f * UI_UNIT_X);
ui_draw_but_COLORBAND(but, &tui->wcol_regular, rect);
break;