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:
authorJeroen Bakker <jeroen@blender.org>2020-11-12 11:14:36 +0300
committerJeroen Bakker <jeroen@blender.org>2020-11-12 11:14:36 +0300
commit08452d995664f6e5605d282374746c305f28fa52 (patch)
treebae7ed9420d0ff051db866f326f92721f7184f5c /source/blender/editors/sculpt_paint/paint_utils.c
parentcd2dfacfa574f99acb06c0d020d96b2be714aa20 (diff)
parentc08827e659e5f48034b4f9d4612bd309ea63ff03 (diff)
Merge branch 'blender-v2.91-release'
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_utils.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_utils.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c
index beffb97bf3f..2484f382ed4 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -581,8 +581,12 @@ void paint_sample_color(
/* Sample from the active image buffer. The sampled color is in
* Linear Scene Reference Space. */
float rgba_f[3];
- if (ED_space_image_color_sample(sima, region, (int[2]){x, y}, rgba_f)) {
- linearrgb_to_srgb_v3_v3(rgba_f, rgba_f);
+ bool is_data;
+ if (ED_space_image_color_sample(sima, region, (int[2]){x, y}, rgba_f, &is_data)) {
+ if (!is_data) {
+ linearrgb_to_srgb_v3_v3(rgba_f, rgba_f);
+ }
+
if (use_palette) {
copy_v3_v3(color->rgb, rgba_f);
}