Fix T60441, T60619: incorrect values for color values > 1.0
Modulo makes no sense here at all, is from an old bugfix to prevent a crash that is no longer an issue. Differential Revision: https://developer.blender.org/D4727
This commit is contained in:
committed by
Brecht Van Lommel
parent
2be3a75efd
commit
8db514f81d
@@ -194,7 +194,6 @@ static void ui_update_color_picker_buts_rgb(uiBut *from_but,
|
||||
else if (STREQ(bt->str, "Hex: ")) {
|
||||
float rgb_hex[3];
|
||||
uchar rgb_hex_uchar[3];
|
||||
double intpart;
|
||||
char col[16];
|
||||
|
||||
/* Hex code is assumed to be in sRGB space
|
||||
@@ -204,16 +203,6 @@ static void ui_update_color_picker_buts_rgb(uiBut *from_but,
|
||||
IMB_colormanagement_scene_linear_to_srgb_v3(rgb_hex);
|
||||
}
|
||||
|
||||
if (rgb_hex[0] > 1.0f) {
|
||||
rgb_hex[0] = modf(rgb_hex[0], &intpart);
|
||||
}
|
||||
if (rgb_hex[1] > 1.0f) {
|
||||
rgb_hex[1] = modf(rgb_hex[1], &intpart);
|
||||
}
|
||||
if (rgb_hex[2] > 1.0f) {
|
||||
rgb_hex[2] = modf(rgb_hex[2], &intpart);
|
||||
}
|
||||
|
||||
rgb_float_to_uchar(rgb_hex_uchar, rgb_hex);
|
||||
BLI_snprintf(col, sizeof(col), "%02X%02X%02X", UNPACK3_EX((uint), rgb_hex_uchar, ));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user