From a44d24a9896a3290c4a3ecd1ff2aa0ea629d41a9 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Fri, 20 Dec 2002 13:48:47 +0000 Subject: Petite optimisation de la fonction de d�composition des transfos. --- generic/Transfo.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'generic') diff --git a/generic/Transfo.c b/generic/Transfo.c index a45b701..6c1c408 100644 --- a/generic/Transfo.c +++ b/generic/Transfo.c @@ -395,8 +395,14 @@ ZnTransfoDecompose(ZnTransfo *t, local._[1][1] -= local._[0][1]*shear; len = sqrt(local._[1][0]*local._[1][0] + local._[1][1]*local._[1][1]); /* Get y scale from 2nd row */ - if (scale) + if (scale) { scale->y = len < PRECISION_LIMIT ? 0.0 : len; + } + + if (!shearxy && !rotation) { + return; + } + local._[1][0] /= len; /* Normalize 2nd row */ local._[1][1] /= len; shear /= len; @@ -404,6 +410,11 @@ ZnTransfoDecompose(ZnTransfo *t, *shearxy = ABS(shear) < PRECISION_LIMIT ? 0.0 : shear; //printf("shear %f\n", *shearxy); } + + if (!rotation) { + return; + } + //printf("Matrix after scale & shear extracted\n"); //ZnPrintTransfo(&local); /* Get rotation */ -- cgit v1.1