From c28c1ca34e857fd088e58cc8b5ad61e8032e9d47 Mon Sep 17 00:00:00 2001 From: "dcone%netscape.com" Date: Mon, 15 May 2000 14:06:18 +0000 Subject: [PATCH] Fixed ScaleX and ScaleY to handle identity matrix, based on O'Callahan patch. --- gfx/src/nsTransform2D.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/gfx/src/nsTransform2D.cpp b/gfx/src/nsTransform2D.cpp index 41d098e0153..d08d9a7d4fe 100644 --- a/gfx/src/nsTransform2D.cpp +++ b/gfx/src/nsTransform2D.cpp @@ -308,10 +308,13 @@ void nsTransform2D :: ScaleXCoords(const nscoord* aSrc, PRUint32 aNumCoords, PRIntn* aDst) { +const nscoord* end = aSrc + aNumCoords; - if (type != MG_2DIDENTITY) - { - const nscoord* end = aSrc + aNumCoords; + if (type == MG_2DIDENTITY){ + while (aSrc < end ) { + *aDst++ = PRIntn(*aSrc++); + } + } else { float scale = m00; while (aSrc < end) { nscoord c = *aSrc++; @@ -324,10 +327,13 @@ void nsTransform2D :: ScaleYCoords(const nscoord* aSrc, PRUint32 aNumCoords, PRIntn* aDst) { +const nscoord* end = aSrc + aNumCoords; - if (type != MG_2DIDENTITY) - { - const nscoord* end = aSrc + aNumCoords; + if (type == MG_2DIDENTITY){ + while (aSrc < end ) { + *aDst++ = PRIntn(*aSrc++); + } + } else { float scale = m11; while (aSrc < end) { nscoord c = *aSrc++;