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:
authormano-wii <germano.costa@ig.com.br>2020-01-17 05:32:45 +0300
committermano-wii <germano.costa@ig.com.br>2020-01-17 05:32:45 +0300
commit9b3c9ab61a4feefc0b2ad2cc9227b81cfe5446d5 (patch)
tree7fe67e87c445e521b914f0e057b941a2e296cac2 /source/blender/compositor
parent6257cdc376af02e93b61073b67ffc0514f8af4ac (diff)
Fix T53178: Casting in Blur node with Relative
In this case the user expects rounding.
Diffstat (limited to 'source/blender/compositor')
-rw-r--r--source/blender/compositor/operations/COM_BlurBaseOperation.cpp18
1 files changed, 10 insertions, 8 deletions
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);