From e59db7a88a36b26c75767058d4bc3bb799e23f86 2016-01-19 12:01:01 From: Andy Shaw Date: 2016-01-19 12:01:01 Subject: [PATCH] Respect the devicePixelRatio when rendering the scene Change-Id: Ib50404453bdbae4749bca4cb3106c044a5e132da Reviewed-by: Titta Heikkala Reviewed-by: Miikka Heikkinen --- diff --git a/src/chartsqml2/declarativechart.cpp b/src/chartsqml2/declarativechart.cpp index d76180a..ab0a612 100644 --- a/src/chartsqml2/declarativechart.cpp +++ b/src/chartsqml2/declarativechart.cpp @@ -590,7 +590,9 @@ void DeclarativeChart::renderScene() QSize chartSize = m_chart->size().toSize(); if (!m_sceneImage || chartSize != m_sceneImage->size()) { delete m_sceneImage; - m_sceneImage = new QImage(chartSize, QImage::Format_ARGB32); + qreal dpr = window() ? window()->devicePixelRatio() : 1.0; + m_sceneImage = new QImage(chartSize * dpr, QImage::Format_ARGB32); + m_sceneImage->setDevicePixelRatio(dpr); m_sceneImageNeedsClear = true; }