Skip to content

Commit c1aebfc

Browse files
committed
Use screen pixel ratio to render sharp text in pixel view tool
Signed-off-by: Aleksandr Motsjonov <[email protected]>
1 parent 830db0f commit c1aebfc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/iv/ivgl.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,9 @@ IvGL::shadowed_text(float x, float y, float /*z*/, const std::string& s,
690690
* Paint on intermediate QImage, AA text on QOpenGLWidget based
691691
* QPaintDevice requires MSAA
692692
*/
693-
QImage t(size(), QImage::Format_ARGB32_Premultiplied);
693+
qreal dpr = devicePixelRatio();
694+
QImage t(size() * dpr, QImage::Format_ARGB32_Premultiplied);
695+
t.setDevicePixelRatio(dpr);
694696
t.fill(qRgba(0, 0, 0, 0));
695697
{
696698
QPainter painter(&t);

0 commit comments

Comments
 (0)