From b0fc0baafe44cdb6e9de7a8d0b497940e00a09d9 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Wed, 24 Oct 2012 08:59:36 +0000 Subject: Updated crop image setting to make every pixel outside the crop black as it is expected. Fix for [#32955] Compositer "Crop" node option "Crop Image Size" doesn't really crop the input image --- source/blender/compositor/operations/COM_CropOperation.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source/blender/compositor/operations') diff --git a/source/blender/compositor/operations/COM_CropOperation.cpp b/source/blender/compositor/operations/COM_CropOperation.cpp index 925374c79ed..25a73799eff 100644 --- a/source/blender/compositor/operations/COM_CropOperation.cpp +++ b/source/blender/compositor/operations/COM_CropOperation.cpp @@ -114,5 +114,12 @@ void CropImageOperation::determineResolution(unsigned int resolution[2], unsigne void CropImageOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { - this->m_inputOperation->read(output, (x + this->m_xmin), (y + this->m_ymin), sampler); + if (x >= 0 && x < getWidth() && y >= 0 && y < getHeight()) + { + this->m_inputOperation->read(output, (x + this->m_xmin), (y + this->m_ymin), sampler); + } + else + { + zero_v4(output); + } } -- cgit v1.2.3