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>2015-10-08 02:16:54 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-10-08 02:16:54 +0300
commit8918e089a5efed8aec0317ecad22efa68dabd6d3 (patch)
tree11b849d8c16478755a14f98e6eb3cf9861320128 /source/blender/compositor
parent27ff2be921e83015da52fbc91141d55f2cd2dc57 (diff)
Fix T46408: Transform (bicubic) ID channel fails
Diffstat (limited to 'source/blender/compositor')
-rw-r--r--source/blender/compositor/operations/COM_IDMaskOperation.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/compositor/operations/COM_IDMaskOperation.cpp b/source/blender/compositor/operations/COM_IDMaskOperation.cpp
index a021f07d2a7..68e681c1326 100644
--- a/source/blender/compositor/operations/COM_IDMaskOperation.cpp
+++ b/source/blender/compositor/operations/COM_IDMaskOperation.cpp
@@ -38,7 +38,9 @@ void IDMaskOperation::executePixelSampled(float output[4], float x, float y, Pix
float inputValue[4];
this->m_inputProgram->readSampled(inputValue, x, y, sampler);
- const float a = (inputValue[0] == this->m_objectIndex) ? 1.0f : 0.0f;
+ /* 'round' since sampling may adjust value slightly.
+ * ID-mask input are originally integers too. */
+ const float a = (roundf(inputValue[0]) == this->m_objectIndex) ? 1.0f : 0.0f;
output[0] = a;
}