diff options
| author | Liam P. White <inkscapebrony@gmail.com> | 2014-11-09 03:14:56 +0000 |
|---|---|---|
| committer | Liam P. White <inkscapebrony@gmail.com> | 2014-11-09 03:14:56 +0000 |
| commit | 24f99d6d91f18670025b8e19c63a8ad6f0fdd1b5 (patch) | |
| tree | a210411e0bc8d7472ca5cabe31df02bf2ad90d89 /src/svg | |
| parent | windows: fix running of cxxtests. (diff) | |
| download | inkscape-24f99d6d91f18670025b8e19c63a8ad6f0fdd1b5.tar.gz inkscape-24f99d6d91f18670025b8e19c63a8ad6f0fdd1b5.zip | |
Fix bug in previous commit. Add test against it
(bzr r13690)
Diffstat (limited to 'src/svg')
| -rw-r--r-- | src/svg/svg-affine-test.h | 5 | ||||
| -rw-r--r-- | src/svg/svg-affine.cpp | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/svg/svg-affine-test.h b/src/svg/svg-affine-test.h index d44f2f714..6d8387328 100644 --- a/src/svg/svg-affine-test.h +++ b/src/svg/svg-affine-test.h @@ -34,7 +34,7 @@ private: static char const * const read_fail_tests[25]; static test_t const write_matrix_tests[2]; static test_t const write_translate_tests[3]; - static test_t const write_scale_tests[2]; + static test_t const write_scale_tests[3]; static test_t const write_rotate_tests[2]; static test_t const write_skew_tests[3]; public: @@ -238,8 +238,9 @@ SvgAffineTest::test_t const SvgAffineTest::write_translate_tests[3] = { {"translate(1,1)",Geom::Affine(1,0,0,1,1,1)}, {"translate(1)",Geom::Affine(1,0,0,1,1,0)}, {"translate(-1345,0.123)",Geom::Affine(1,0,0,1,-1.345e3,.123)}}; -SvgAffineTest::test_t const SvgAffineTest::write_scale_tests[2] = { +SvgAffineTest::test_t const SvgAffineTest::write_scale_tests[3] = { {"scale(0)",Geom::Affine(0,0,0,0,0,0)}, + {"scale(7)",Geom::Affine(7,0,0,7,0,0)}, {"scale(2,3)",Geom::Affine(2,0,0,3,0,0)}}; SvgAffineTest::test_t const SvgAffineTest::write_rotate_tests[2] = { {"rotate(13)",Geom::Affine(cos(13.*DEGREE),sin(13.*DEGREE),-sin(13.*DEGREE),cos(13.*DEGREE),0,0)}, diff --git a/src/svg/svg-affine.cpp b/src/svg/svg-affine.cpp index b2b8744db..af58c4544 100644 --- a/src/svg/svg-affine.cpp +++ b/src/svg/svg-affine.cpp @@ -184,7 +184,7 @@ sp_svg_transform_write(Geom::Affine const &transform) strcpy (c + p, "scale("); p += 6; p += sp_svg_number_write_de( c + p, sizeof(c) - p, transform[0], prec, min_exp ); - if (Geom::are_near(transform[3], 0.0, e)) { + if (Geom::are_near(transform[0], transform[3], e)) { c[p++] = ')'; c[p] = '\000'; } else { |
