undo the "cosmetic changes" of 2005-03-20. Fixes bug #300269.

2005-04-12  Michael Natterer  <mitch@gimp.org>

	* app/core/gimp-transform-utils.c
	(gimp_transform_matrix_perspective): undo the "cosmetic changes"
	of 2005-03-20. Fixes bug #300269.
This commit is contained in:
Michael Natterer 2005-04-12 09:09:41 +00:00 committed by Michael Natterer
parent 5d300d575b
commit b64b4a8f9a
2 changed files with 15 additions and 10 deletions

View File

@ -1,3 +1,9 @@
2005-04-12 Michael Natterer <mitch@gimp.org>
* app/core/gimp-transform-utils.c
(gimp_transform_matrix_perspective): undo the "cosmetic changes"
of 2005-03-20. Fixes bug #300269.
2005-04-12 Raphaël Quinet <raphael@gimp.org>
* configure.in: updated test for libjpeg so that it requires

View File

@ -255,20 +255,11 @@ gimp_transform_matrix_perspective (GimpMatrix3 *matrix,
trafo.coeff[1][2] = t_y1;
trafo.coeff[2][0] = 0.0;
trafo.coeff[2][1] = 0.0;
trafo.coeff[2][2] = 1.0;
}
else
{
gdouble det1, det2;
trafo.coeff[0][0] = t_x2 - t_x1 + trafo.coeff[2][0] * t_x2;
trafo.coeff[0][1] = t_x3 - t_x1 + trafo.coeff[2][1] * t_x3;
trafo.coeff[0][2] = t_x1;
trafo.coeff[1][0] = t_y2 - t_y1 + trafo.coeff[2][0] * t_y2;
trafo.coeff[1][1] = t_y3 - t_y1 + trafo.coeff[2][1] * t_y3;
trafo.coeff[1][2] = t_y1;
det1 = dx3 * dy2 - dy3 * dx2;
det2 = dx1 * dy2 - dy1 * dx2;
@ -278,8 +269,16 @@ gimp_transform_matrix_perspective (GimpMatrix3 *matrix,
trafo.coeff[2][1] = (det2 == 0.0) ? 1.0 : det1 / det2;
trafo.coeff[2][2] = 1.0;
trafo.coeff[0][0] = t_x2 - t_x1 + trafo.coeff[2][0] * t_x2;
trafo.coeff[0][1] = t_x3 - t_x1 + trafo.coeff[2][1] * t_x3;
trafo.coeff[0][2] = t_x1;
trafo.coeff[1][0] = t_y2 - t_y1 + trafo.coeff[2][0] * t_y2;
trafo.coeff[1][1] = t_y3 - t_y1 + trafo.coeff[2][1] * t_y3;
trafo.coeff[1][2] = t_y1;
}
trafo.coeff[2][2] = 1.0;
}
gimp_matrix3_mult (&trafo, matrix);