From f42f1366dcd4b070c69c9e7fe42a704ef23da14d Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 13 Jan 2017 12:45:08 +0100 Subject: Use the image handler to return a scaled size for the SVG When the SVG was made to be drawn at a small width and a large height then it would lead to blurring in the rendering of the SVG. By having the image handler deal with returning the image we want for the scaled size it will ensure this is rendered correctly since it is able to account for the ratio already inside the SVG image handler. Task-number: QTBUG-65789 Change-Id: Ib8627c0537679aab022e88a0eea73a21d8cbc564 Reviewed-by: Shawn Rutledge --- tests/auto/quick/qquickimage/tst_qquickimage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto/quick/qquickimage/tst_qquickimage.cpp') diff --git a/tests/auto/quick/qquickimage/tst_qquickimage.cpp b/tests/auto/quick/qquickimage/tst_qquickimage.cpp index a2a65aa803..f6720f96e3 100644 --- a/tests/auto/quick/qquickimage/tst_qquickimage.cpp +++ b/tests/auto/quick/qquickimage/tst_qquickimage.cpp @@ -400,11 +400,11 @@ void tst_qquickimage::svg() component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); QQuickImage *obj = qobject_cast(component.create()); QVERIFY(obj != 0); - QCOMPARE(int(obj->width()), 212); // round down: highdpi can give back fractional values + QCOMPARE(obj->width(), 300.0); QCOMPARE(obj->height(), 300.0); obj->setSourceSize(QSize(200,200)); - QCOMPARE(int(obj->width()), 141); // round down: highdpi can give back fractional values + QCOMPARE(obj->width(), 200.0); QCOMPARE(obj->height(), 200.0); delete obj; } -- cgit v1.2.3