From b64b4a8f9a01afcd45c2667aa70d8c40df2e7c19 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Tue, 12 Apr 2005 09:09:41 +0000 Subject: [PATCH] undo the "cosmetic changes" of 2005-03-20. Fixes bug #300269. 2005-04-12 Michael Natterer * app/core/gimp-transform-utils.c (gimp_transform_matrix_perspective): undo the "cosmetic changes" of 2005-03-20. Fixes bug #300269. --- ChangeLog | 6 ++++++ app/core/gimp-transform-utils.c | 19 +++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index a96abc4449..7003f64e67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-04-12 Michael Natterer + + * 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 * configure.in: updated test for libjpeg so that it requires diff --git a/app/core/gimp-transform-utils.c b/app/core/gimp-transform-utils.c index ecc82c575d..0eef874621 100644 --- a/app/core/gimp-transform-utils.c +++ b/app/core/gimp-transform-utils.c @@ -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);