Commit: 67dc68d104a5b2d62e49a94f2a26b0b28c94fac6
Author: mano-wii
Date:   Sun Dec 23 23:32:56 2018 -0200
Branches: master
https://developer.blender.org/rB67dc68d104a5b2d62e49a94f2a26b0b28c94fac6

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.

===================================================================

M       source/blender/editors/include/UI_resources.h
M       source/blender/editors/interface/resources.c
M       source/blender/editors/mesh/editmesh_knife.c

===================================================================

diff --git a/source/blender/editors/include/UI_resources.h 
b/source/blender/editors/include/UI_resources.h
index 277aae923d6..0be8f91cca6 100644
--- a/source/blender/editors/include/UI_resources.h
+++ b/source/blender/editors/include/UI_resources.h
@@ -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
diff --git a/source/blender/editors/interface/resources.c 
b/source/blender/editors/interface/resources.c
index 09b8933206e..a30dde38852 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -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;
diff --git a/source/blender/editors/mesh/editmesh_knife.c 
b/source/blender/editors/mesh/editmesh_knife.c
index b89a7dd91a1..b85627dc146 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -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;
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to