From 288e36764cf961bcb2bad6c2810c0de5344e77da Mon Sep 17 00:00:00 2001 From: jaseg Date: Sun, 16 Apr 2023 20:13:24 +0200 Subject: [PATCH] svg-flatten: Fix broken math in transform inversion --- svg-flatten/include/geom2d.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/svg-flatten/include/geom2d.hpp b/svg-flatten/include/geom2d.hpp index 7c3b5ba..34455cd 100644 --- a/svg-flatten/include/geom2d.hpp +++ b/svg-flatten/include/geom2d.hpp @@ -234,8 +234,8 @@ namespace gerbolyze { return *this; } - *this = xform2d(yy/det, -yx/det, - -xy/det, xx/det, + *this = xform2d(yy/det, -xy/det, + -yx/det, xx/det, (xy*y0 - yy*x0)/det, (yx*x0 - xx*y0)/det); if (success_out) @@ -300,8 +300,8 @@ namespace gerbolyze { ostringstream os; os << "xform2d< " << setw(5); os << xx << ", " << xy << ", " << x0 << " / "; - os << yy << ", " << yx << ", " << y0 << " / "; - os << "θ=" << theta << ", m=" << m << " s=(" << s_x << ", " << s_y << " | "; + os << yx << ", " << yy << ", " << y0 << " / "; + os << "θ=" << theta << ", m=" << m << " s=(" << s_x << ", " << s_y << ") | "; os << "f_min=" << f_min << ", f_max=" << f_max; os << " >"; return os.str();