Skip to content

Commit

Permalink
Fix SVG display on high DPI
Browse files Browse the repository at this point in the history
Possibly related to JuliaGraphics/QML.jl#53
  • Loading branch information
Bart Janssens committed Dec 20, 2018
1 parent 5fac21f commit 03b5dd3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion julia_display.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <QDebug>
#include <QPainter>
#include <QQuickWindow>

#include "julia_display.hpp"
namespace qmlwrap
Expand All @@ -17,7 +18,8 @@ void JuliaDisplay::paint(QPainter *painter)
}
else if(m_svg_renderer != nullptr)
{
m_svg_renderer->render(painter);
const qreal dpr = this->window()->effectiveDevicePixelRatio();
m_svg_renderer->render(painter, QRectF(QPointF(0,0),QSizeF(painter->device()->width()/dpr,painter->device()->height()/dpr)));
}
}

Expand Down

0 comments on commit 03b5dd3

Please sign in to comment.