Commit 59ef222c authored by Ell's avatar Ell

app: in gimp_transform_matrix_generic(), apply matrix even if invalid

In gimp_transform_matrix_generic(), apply the resulting matrix even
if the transformation is invalid, since GimpGenericTransformTool
relies on the matrix to properly update the transform-grid widget.
parent 7ed51204
......@@ -441,8 +441,9 @@ gimp_transform_matrix_generic (GimpMatrix3 *matrix,
{
GimpMatrix3 trafo;
gdouble coeff[8 * 9];
gboolean negative;
gboolean negative = -1;
gint i;
gboolean result = TRUE;
g_return_val_if_fail (matrix != NULL, FALSE);
g_return_val_if_fail (input_points != NULL, FALSE);
......@@ -494,21 +495,26 @@ gimp_transform_matrix_generic (GimpMatrix3 *matrix,
trafo.coeff[2][2];
if (fabs (w) <= EPSILON)
return FALSE;
result = FALSE;
neg = (w < 0.0);
if (i == 0)
negative = neg;
if (negative < 0)
{
negative = neg;
}
else if (neg != negative)
return FALSE;
{
result = FALSE;
break;
}
}
/* if the output points are all behind the camera, negate the matrix, which
* would map the input points to the corresponding points in front of the
* camera.
*/
if (negative)
if (negative > 0)
{
gint r;
gint c;
......@@ -525,7 +531,7 @@ gimp_transform_matrix_generic (GimpMatrix3 *matrix,
/* append the transformation to 'matrix' */
gimp_matrix3_mult (&trafo, matrix);
return TRUE;
return result;
}
gboolean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment