Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-11-04 10:12:58 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-11-04 10:12:58 +0300
commit0d69a5aa3491501c4a556aec3978128c041d328e (patch)
tree1a26cc1730348fb1323408be28f73511d3723e8d /source/blender/editors/sculpt_paint/paint_image_2d.c
parent179358e6c479ee083dd70b56dc9206fd4a1e5206 (diff)
parent76b9eaf7a84ee2098c1ca1bf5cd4042c55ae76d7 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image_2d.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_2d.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c
index a6f367b3d46..6b2287290d1 100644
--- a/source/blender/editors/sculpt_paint/paint_image_2d.c
+++ b/source/blender/editors/sculpt_paint/paint_image_2d.c
@@ -1421,8 +1421,9 @@ static void paint_2d_fill_add_pixel_byte(
float color_f[4];
unsigned char *color_b = (unsigned char *)(ibuf->rect + coordinate);
rgba_uchar_to_float(color_f, color_b);
+ straight_to_premul_v4(color_f);
- if (compare_len_squared_v3v3(color_f, color, threshold_sq)) {
+ if (compare_len_squared_v4v4(color_f, color, threshold_sq)) {
BLI_stack_push(stack, &coordinate);
}
BLI_BITMAP_SET(touched, coordinate, true);
@@ -1441,7 +1442,7 @@ static void paint_2d_fill_add_pixel_float(
coordinate = ((size_t)y_px) * ibuf->x + x_px;
if (!BLI_BITMAP_TEST(touched, coordinate)) {
- if (compare_len_squared_v3v3(ibuf->rect_float + 4 * coordinate, color, threshold_sq)) {
+ if (compare_len_squared_v4v4(ibuf->rect_float + 4 * coordinate, color, threshold_sq)) {
BLI_stack_push(stack, &coordinate);
}
BLI_BITMAP_SET(touched, coordinate, true);
@@ -1548,6 +1549,7 @@ void paint_2d_bucket_fill(
else {
int pixel_color_b = *(ibuf->rect + coordinate);
rgba_uchar_to_float(pixel_color, (unsigned char *)&pixel_color_b);
+ straight_to_premul_v4(pixel_color);
}
BLI_stack_push(stack, &coordinate);