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:
Diffstat (limited to 'source/blender/compositor/operations/COM_FlipOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_FlipOperation.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/compositor/operations/COM_FlipOperation.cpp b/source/blender/compositor/operations/COM_FlipOperation.cpp
index 3de2ae9dabc..7ff7d694fa8 100644
--- a/source/blender/compositor/operations/COM_FlipOperation.cpp
+++ b/source/blender/compositor/operations/COM_FlipOperation.cpp
@@ -44,8 +44,8 @@ void FlipOperation::deinitExecution()
void FlipOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
- float nx = this->m_flipX ? this->getWidth() - 1 - x : x;
- float ny = this->m_flipY ? this->getHeight() - 1 - y : y;
+ float nx = this->m_flipX ? ((int)this->getWidth() - 1) - x : x;
+ float ny = this->m_flipY ? ((int)this->getHeight() - 1) - y : y;
this->m_inputOperation->readSampled(output, nx, ny, sampler);
}
@@ -55,16 +55,18 @@ bool FlipOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOper
rcti newInput;
if (this->m_flipX) {
- newInput.xmax = (this->getWidth() - 1 - input->xmin) + 1;
- newInput.xmin = (this->getWidth() - 1 - input->xmax) - 1;
+ const int w = (int)this->getWidth() - 1;
+ newInput.xmax = (w - input->xmin) + 1;
+ newInput.xmin = (w - input->xmax) - 1;
}
else {
newInput.xmin = input->xmin;
newInput.xmax = input->xmax;
}
if (this->m_flipY) {
- newInput.ymax = (this->getHeight() - 1 - input->ymin) + 1;
- newInput.ymin = (this->getHeight() - 1 - input->ymax) - 1;
+ const int h = (int)this->getHeight() - 1;
+ newInput.ymax = (h - input->ymin) + 1;
+ newInput.ymin = (h - input->ymax) - 1;
}
else {
newInput.ymin = input->ymin;