From 771146226b10e7052154dea3be83d957ac1d16ba Mon Sep 17 00:00:00 2001 From: Jean-Philippe Jodoin Date: Thu, 24 Jul 2014 16:23:22 -0400 Subject: [PATCH] Bug fix for rotation handling. We were doing [T][R0][T-1] instead of [T-1][R0][T] because of the premultiply in nsvg__parseRotate. --- src/nanosvg.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nanosvg.h b/src/nanosvg.h index ba5ec3c..d611344 100644 --- a/src/nanosvg.h +++ b/src/nanosvg.h @@ -1326,15 +1326,15 @@ static int nsvg__parseRotate(float* xform, const char* str) if (na > 1) { nsvg__xformSetTranslation(t, -args[1], -args[2]); - nsvg__xformPremultiply(m, t); + nsvg__xformMultiply(m, t); } - + nsvg__xformSetRotation(t, args[0]/180.0f*NSVG_PI); - nsvg__xformPremultiply(m, t); + nsvg__xformMultiply(m, t); if (na > 1) { nsvg__xformSetTranslation(t, args[1], args[2]); - nsvg__xformPremultiply(m, t); + nsvg__xformMultiply(m, t); } memcpy(xform, m, sizeof(float)*6);