Commit: 9b3c9ab61a4feefc0b2ad2cc9227b81cfe5446d5
Author: mano-wii
Date: Thu Jan 16 23:32:45 2020 -0300
Branches: blender-v2.82-release
https://developer.blender.org/rB9b3c9ab61a4feefc0b2ad2cc9227b81cfe5446d5
Fix T53178: Casting in Blur node with Relative
In this case the user expects rounding.
===================================================================
M source/blender/compositor/operations/COM_BlurBaseOperation.cpp
===================================================================
diff --git a/source/blender/compositor/operations/COM_BlurBaseOperation.cpp
b/source/blender/compositor/operations/COM_BlurBaseOperation.cpp
index 1b2e3b2821e..24c68ddbec7 100644
--- a/source/blender/compositor/operations/COM_BlurBaseOperation.cpp
+++ b/source/blender/compositor/operations/COM_BlurBaseOperation.cpp
@@ -44,20 +44,22 @@ void BlurBaseOperation::initExecution()
this->m_data.image_in_width = this->getWidth();
this->m_data.image_in_height = this->getHeight();
if (this->m_data.relative) {
+ int sizex, sizey;
switch (this->m_data.aspect) {
- case CMP_NODE_BLUR_ASPECT_NONE:
- this->m_data.sizex = (int)(this->m_data.percentx * 0.01f *
this->m_data.image_in_width);
- this->m_data.sizey = (int)(this->m_data.percenty * 0.01f *
this->m_data.image_in_height);
- break;
case CMP_NODE_BLUR_ASPECT_Y:
- this->m_data.sizex = (int)(this->m_data.percentx * 0.01f *
this->m_data.image_in_width);
- this->m_data.sizey = (int)(this->m_data.percenty * 0.01f *
this->m_data.image_in_width);
+ sizex = sizey = this->m_data.image_in_width;
break;
case CMP_NODE_BLUR_ASPECT_X:
- this->m_data.sizex = (int)(this->m_data.percentx * 0.01f *
this->m_data.image_in_height);
- this->m_data.sizey = (int)(this->m_data.percenty * 0.01f *
this->m_data.image_in_height);
+ sizex = sizey = this->m_data.image_in_height;
+ break;
+ default:
+ BLI_assert(this->m_data.aspect == CMP_NODE_BLUR_ASPECT_NONE);
+ sizex = this->m_data.image_in_width;
+ sizey = this->m_data.image_in_height;
break;
}
+ this->m_data.sizex = round_fl_to_int(this->m_data.percentx * 0.01f *
sizex);
+ this->m_data.sizey = round_fl_to_int(this->m_data.percenty * 0.01f *
sizey);
}
QualityStepHelper::initExecution(COM_QH_MULTIPLY);
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs