aboutsummaryrefslogtreecommitdiffstats
path: root/libtests/matrix.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2021-02-12 09:44:12 +0100
committerJay Berkenbilt <ejb@ql.org>2021-02-13 08:30:00 +0100
commit07f40bd25442f25c0af948ae1b0dac7fdff1688c (patch)
tree3fca13d92b02bc3712d98c3c43f9612ae4c56cf1 /libtests/matrix.cc
parent8fbc8579f2481dc3eeb962e99522047291e16fbe (diff)
downloadqpdf-07f40bd25442f25c0af948ae1b0dac7fdff1688c.tar.zst
QUtil::double_to_string: trim trailing zeroes with option to disable
Diffstat (limited to 'libtests/matrix.cc')
-rw-r--r--libtests/matrix.cc28
1 files changed, 14 insertions, 14 deletions
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);