summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2020-01-27 14:22:19 +0100
committerEirik Aavitsland <eirik.aavitsland@qt.io>2020-01-28 10:21:12 +0100
commit84bc219fb1e9f586c1f7ac2c10172c4da2605f96 (patch)
tree99d22acb9c4924fa6cd7e3bad23aed4273321445 /tests
parent69175cddec56c681b7873d6145cc29e461f1d8b1 (diff)
downloadqtsvg-84bc219fb1e9f586c1f7ac2c10172c4da2605f96.tar.gz
Add API to enable opt-in aspect ratio feature in QSvgRenderer
[ChangeLog][QSvgRenderer] Introduced aspect ratio mode property, so that rendering may be set to preserve the view box aspect ratio. Task-number: QTBUG-81259 Change-Id: I9802788cdaf2c30974c1ffc34ad5b67cdc74ed57 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp b/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp
index 14cb473..686c854 100644
--- a/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp
+++ b/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp
@@ -270,18 +270,17 @@ void tst_QSvgRenderer::testMapViewBoxToTarget()
QCOMPARE(picture.boundingRect(), QRect(125, 125, 250, 250));
}
-#if 0
// Requires keep-aspectratio feature
{ // Viewport and viewBox specified -> scale 500x500 square to 1000x750 while preserving aspect ratio gives 750x750
data = "<svg width=\"1000\" height=\"750\" viewBox=\"-250 -250 500 500\"><g><rect x=\"0\" y=\"0\" width=\"500\" height=\"500\" /></g></svg>";
QPicture picture;
QPainter painter(&picture);
QSvgRenderer rend(data);
+ rend.setAspectRatioMode(Qt::KeepAspectRatio);
rend.render(&painter);
painter.end();
QCOMPARE(picture.boundingRect(), QRect(500, 375, 750, 750));
}
-#endif
}
void tst_QSvgRenderer::testRenderElement()