[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51483] trunk/blender/source/blender/ compositor/operations/COM_CropOperation.cpp: Fix for [#32931] Crop node resets values to 0
Jeroen Bakker
j.bakker at atmind.nl
Sun Oct 21 20:56:49 CEST 2012
Revision: 51483
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51483
Author: jbakker
Date: 2012-10-21 18:56:48 +0000 (Sun, 21 Oct 2012)
Log Message:
-----------
Fix for [#32931] Crop node resets values to 0
Patch done by Markus Kasten
Thanks for that!
Modified Paths:
--------------
trunk/blender/source/blender/compositor/operations/COM_CropOperation.cpp
Modified: trunk/blender/source/blender/compositor/operations/COM_CropOperation.cpp
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_CropOperation.cpp 2012-10-21 15:20:53 UTC (rev 51482)
+++ trunk/blender/source/blender/compositor/operations/COM_CropOperation.cpp 2012-10-21 18:56:48 UTC (rev 51483)
@@ -36,25 +36,29 @@
SocketReader *inputReference = this->getInputSocketReader(0);
float width = inputReference->getWidth();
float height = inputReference->getHeight();
- if (this->m_relative) {
- this->m_settings->x1 = width * this->m_settings->fac_x1;
- this->m_settings->x2 = width * this->m_settings->fac_x2;
- this->m_settings->y1 = height * this->m_settings->fac_y1;
- this->m_settings->y2 = height * this->m_settings->fac_y2;
+
+ if (width > 0.0f && height > 0.0f)
+ {
+ if (this->m_relative) {
+ this->m_settings->x1 = width * this->m_settings->fac_x1;
+ this->m_settings->x2 = width * this->m_settings->fac_x2;
+ this->m_settings->y1 = height * this->m_settings->fac_y1;
+ this->m_settings->y2 = height * this->m_settings->fac_y2;
+ }
+ if (width <= this->m_settings->x1 + 1)
+ this->m_settings->x1 = width - 1;
+ if (height <= this->m_settings->y1 + 1)
+ this->m_settings->y1 = height - 1;
+ if (width <= this->m_settings->x2 + 1)
+ this->m_settings->x2 = width - 1;
+ if (height <= this->m_settings->y2 + 1)
+ this->m_settings->y2 = height - 1;
+
+ this->m_xmax = MAX2(this->m_settings->x1, this->m_settings->x2) + 1;
+ this->m_xmin = MIN2(this->m_settings->x1, this->m_settings->x2);
+ this->m_ymax = MAX2(this->m_settings->y1, this->m_settings->y2) + 1;
+ this->m_ymin = MIN2(this->m_settings->y1, this->m_settings->y2);
}
- if (width <= this->m_settings->x1 + 1)
- this->m_settings->x1 = width - 1;
- if (height <= this->m_settings->y1 + 1)
- this->m_settings->y1 = height - 1;
- if (width <= this->m_settings->x2 + 1)
- this->m_settings->x2 = width - 1;
- if (height <= this->m_settings->y2 + 1)
- this->m_settings->y2 = height - 1;
-
- this->m_xmax = MAX2(this->m_settings->x1, this->m_settings->x2) + 1;
- this->m_xmin = MIN2(this->m_settings->x1, this->m_settings->x2);
- this->m_ymax = MAX2(this->m_settings->y1, this->m_settings->y2) + 1;
- this->m_ymin = MIN2(this->m_settings->y1, this->m_settings->y2);
}
void CropBaseOperation::initExecution()
More information about the Bf-blender-cvs
mailing list