From 00e7a4b5a70c64c6f1961b860c50d93daee4cbf7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 22 May 2012 08:24:52 +0000 Subject: fix [#31530] Project paint with Clipping border gives opaque background draw clipping box alpha 0 so reprojection and rendering show the background as alpha 0. --- source/blender/editors/interface/resources.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/interface/resources.c') diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index bf57dda44bf..9d66c9ea2e1 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -1028,7 +1028,7 @@ int UI_GetThemeValue(int colorid) // get the color, range 0.0-1.0 -void UI_GetThemeColor3fv(int colorid, float *col) +void UI_GetThemeColor3fv(int colorid, float col[3]) { const unsigned char *cp; @@ -1039,7 +1039,7 @@ void UI_GetThemeColor3fv(int colorid, float *col) } // get the color, range 0.0-1.0, complete with shading offset -void UI_GetThemeColorShade3fv(int colorid, int offset, float *col) +void UI_GetThemeColorShade3fv(int colorid, int offset, float col[3]) { int r, g, b; const unsigned char *cp; @@ -1058,6 +1058,25 @@ void UI_GetThemeColorShade3fv(int colorid, int offset, float *col) col[2] = ((float)b) / 255.0f; } +void UI_GetThemeColorShade3ubv(int colorid, int offset, unsigned char col[3]) +{ + int r, g, b; + const unsigned char *cp; + + cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid); + + r = offset + (int) cp[0]; + CLAMP(r, 0, 255); + g = offset + (int) cp[1]; + CLAMP(g, 0, 255); + b = offset + (int) cp[2]; + CLAMP(b, 0, 255); + + col[0] = r; + col[1] = g; + col[2] = b; +} + // get the color, in char pointer void UI_GetThemeColor3ubv(int colorid, unsigned char col[3]) { -- cgit v1.2.3