Fix T59505: Knife tool cut preview line becomes black
The real reason for the problem is still unknown, but this solution adds less overhead than rBdafaa6f22881.
This commit is contained in:
@@ -369,6 +369,7 @@ void UI_GetThemeColor3ubv(int colorid, unsigned char col[3]);
|
||||
void UI_GetThemeColor4ubv(int colorid, unsigned char col[4]);
|
||||
|
||||
// get a theme color from specified space type
|
||||
void UI_GetThemeColorType3ubv(int colorid, int spacetype, char col[3]);
|
||||
void UI_GetThemeColorType4ubv(int colorid, int spacetype, char col[4]);
|
||||
|
||||
// get theme color for coloring monochrome icons
|
||||
|
||||
@@ -1118,6 +1118,16 @@ void UI_GetThemeColor4ubv(int colorid, unsigned char col[4])
|
||||
col[3] = cp[3];
|
||||
}
|
||||
|
||||
void UI_GetThemeColorType3ubv(int colorid, int spacetype, char col[3])
|
||||
{
|
||||
const unsigned char *cp;
|
||||
|
||||
cp = UI_ThemeGetColorPtr(theme_active, spacetype, colorid);
|
||||
col[0] = cp[0];
|
||||
col[1] = cp[1];
|
||||
col[2] = cp[2];
|
||||
}
|
||||
|
||||
void UI_GetThemeColorType4ubv(int colorid, int spacetype, char col[4])
|
||||
{
|
||||
const unsigned char *cp;
|
||||
|
||||
@@ -1027,13 +1027,13 @@ static void knife_init_colors(KnifeColors *colors)
|
||||
/* possible BMESH_TODO: add explicit themes or calculate these by
|
||||
* figuring out contrasting colors with grid / edges / verts
|
||||
* a la UI_make_axis_color */
|
||||
UI_GetThemeColor3ubv(TH_NURB_VLINE, colors->line);
|
||||
UI_GetThemeColor3ubv(TH_NURB_ULINE, colors->edge);
|
||||
UI_GetThemeColor3ubv(TH_HANDLE_SEL_VECT, colors->curpoint);
|
||||
UI_GetThemeColor3ubv(TH_HANDLE_SEL_VECT, colors->curpoint_a);
|
||||
UI_GetThemeColorType3ubv(TH_NURB_VLINE, SPACE_VIEW3D, colors->line);
|
||||
UI_GetThemeColorType3ubv(TH_NURB_ULINE, SPACE_VIEW3D, colors->edge);
|
||||
UI_GetThemeColorType3ubv(TH_HANDLE_SEL_VECT, SPACE_VIEW3D, colors->curpoint);
|
||||
UI_GetThemeColorType3ubv(TH_HANDLE_SEL_VECT, SPACE_VIEW3D, colors->curpoint_a);
|
||||
colors->curpoint_a[3] = 102;
|
||||
UI_GetThemeColor3ubv(TH_ACTIVE_SPLINE, colors->point);
|
||||
UI_GetThemeColor3ubv(TH_ACTIVE_SPLINE, colors->point_a);
|
||||
UI_GetThemeColorType3ubv(TH_ACTIVE_SPLINE, SPACE_VIEW3D, colors->point);
|
||||
UI_GetThemeColorType3ubv(TH_ACTIVE_SPLINE, SPACE_VIEW3D, colors->point_a);
|
||||
colors->point_a[3] = 102;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user