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:
-rw-r--r--source/blender/compositor/operations/COM_MapRangeOperation.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/compositor/operations/COM_MapRangeOperation.cpp b/source/blender/compositor/operations/COM_MapRangeOperation.cpp
index 3facaaebc9c..c25b056130b 100644
--- a/source/blender/compositor/operations/COM_MapRangeOperation.cpp
+++ b/source/blender/compositor/operations/COM_MapRangeOperation.cpp
@@ -65,8 +65,14 @@ void MapRangeOperation::executePixel(float output[4], float x, float y, PixelSam
value = (value - source_min) / (source_max - source_min);
value = dest_min + value * (dest_max - dest_min);
- if (this->m_useClamp)
- CLAMP(value, dest_min, dest_max);
+ if (this->m_useClamp) {
+ if (dest_max > dest_min) {
+ CLAMP(value, dest_min, dest_max);
+ }
+ else {
+ CLAMP(value, dest_max, dest_min);
+ }
+ }
output[0] = value;
}