From 07f40bd25442f25c0af948ae1b0dac7fdff1688c Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Fri, 12 Feb 2021 03:44:12 -0500 Subject: QUtil::double_to_string: trim trailing zeroes with option to disable --- libtests/matrix.cc | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'libtests/matrix.cc') diff --git a/libtests/matrix.cc b/libtests/matrix.cc index 77a058ee..ecaa02a0 100644 --- a/libtests/matrix.cc +++ b/libtests/matrix.cc @@ -44,39 +44,39 @@ static void check_rect(QPDFObjectHandle::Rectangle const& r, int main() { QPDFMatrix m; - check(m, "1.00000 0.00000 0.00000 1.00000 0.00000 0.00000"); + check(m, "1 0 0 1 0 0"); m.translate(10, 20); - check(m, "1.00000 0.00000 0.00000 1.00000 10.00000 20.00000"); + check(m, "1 0 0 1 10 20"); m.scale(1.5, 2); - check(m, "1.50000 0.00000 0.00000 2.00000 10.00000 20.00000"); + check(m, "1.5 0 0 2 10 20"); double xp = 0; double yp = 0; m.transform(10, 100, xp, yp); - check_xy(xp, yp, "25.00 220.00"); + check_xy(xp, yp, "25 220"); m.translate(30, 40); - check(m, "1.50000 0.00000 0.00000 2.00000 55.00000 100.00000"); + check(m, "1.5 0 0 2 55 100"); m.transform(10, 100, xp, yp); - check_xy(xp, yp, "70.00 300.00"); + check_xy(xp, yp, "70 300"); m.concat(QPDFMatrix(1, 2, 3, 4, 5, 6)); - check(m, "1.50000 4.00000 4.50000 8.00000 62.50000 112.00000"); + check(m, "1.5 4 4.5 8 62.5 112"); m.rotatex90(90); - check(m, "4.50000 8.00000 -1.50000 -4.00000 62.50000 112.00000"); + check(m, "4.5 8 -1.5 -4 62.5 112"); m.rotatex90(180); - check(m, "-4.50000 -8.00000 1.50000 4.00000 62.50000 112.00000"); + check(m, "-4.5 -8 1.5 4 62.5 112"); m.rotatex90(270); - check(m, "-1.50000 -4.00000 -4.50000 -8.00000 62.50000 112.00000"); + check(m, "-1.5 -4 -4.5 -8 62.5 112"); m.rotatex90(180); - check(m, "1.50000 4.00000 4.50000 8.00000 62.50000 112.00000"); + check(m, "1.5 4 4.5 8 62.5 112"); m.rotatex90(12345); - check(m, "1.50000 4.00000 4.50000 8.00000 62.50000 112.00000"); + check(m, "1.5 4 4.5 8 62.5 112"); m.transform(240, 480, xp, yp); - check_xy(xp, yp, "2582.50 4912.00"); + check_xy(xp, yp, "2582.5 4912"); check(QPDFMatrix( QPDFObjectHandle::parse( "[3 1 4 1 5 9.26535]").getArrayAsMatrix()), - "3.00000 1.00000 4.00000 1.00000 5.00000 9.26535"); + "3 1 4 1 5 9.26535"); m = QPDFMatrix(); m.rotatex90(90); -- cgit v1.2.3-54-g00ecf