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.
This commit is contained in:
Ell 2019-02-04 04:58:34 -05:00
parent 7ed512040e
commit 59ef222c7f
1 changed files with 13 additions and 7 deletions

View File

@ -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