diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-09 23:57:14 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-09 23:57:14 +0400 |
commit | 8e7d7d5ea56c75739164b98f5fb2f97ff51d697b (patch) | |
tree | 7dcdd0f713993af8af39b65cee89b2e11b7f780b /source/blender/compositor/operations/COM_BoxMaskOperation.cpp | |
parent | 2c1abe1f5861330315a1fc58e7dfe298b8356449 (diff) |
code cleanup: reduce float/double promotion
Diffstat (limited to 'source/blender/compositor/operations/COM_BoxMaskOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_BoxMaskOperation.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/compositor/operations/COM_BoxMaskOperation.cpp b/source/blender/compositor/operations/COM_BoxMaskOperation.cpp index 0244be4cad3..ae83115ff69 100644 --- a/source/blender/compositor/operations/COM_BoxMaskOperation.cpp +++ b/source/blender/compositor/operations/COM_BoxMaskOperation.cpp @@ -38,7 +38,7 @@ void BoxMaskOperation::initExecution() { this->inputMask = this->getInputSocketReader(0); this->inputValue = this->getInputSocketReader(1); - const double rad = DEG2RAD(this->data->rotation); + const double rad = DEG2RAD((double)this->data->rotation); this->cosine = cos(rad); this->sine = sin(rad); this->aspectRatio = ((float)this->getWidth())/this->getHeight(); @@ -60,12 +60,12 @@ void BoxMaskOperation::executePixel(float *color, float x, float y, PixelSampler this->inputMask->read(inputMask, x, y, sampler, inputBuffers); this->inputValue->read(inputValue, x, y, sampler, inputBuffers); - float halfHeight = (this->data->height)/2.0f; - float halfWidth = this->data->width/2.0f; - bool inside = rx > this->data->x-halfWidth - && rx < this->data->x+halfWidth - && ry > this->data->y-halfHeight - && ry < this->data->y+halfHeight; + float halfHeight = this->data->height / 2.0f; + float halfWidth = this->data->width / 2.0f; + bool inside = (rx > this->data->x - halfWidth && + rx < this->data->x + halfWidth && + ry > this->data->y - halfHeight && + ry < this->data->y + halfHeight); switch (this->maskType) { case CMP_NODE_MASKTYPE_ADD: |