]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt4/GuiPainter.cpp
Use bilinear filtering when resizing graphics
[features.git] / src / frontends / qt4 / GuiPainter.cpp
index b67441b9b17d26cacc21f5d4cf22d0f5526c33b6..495a11a8a6f036892bb9d088364bb06e228e0583 100644 (file)
@@ -317,7 +317,13 @@ void GuiPainter::image(int x, int y, int w, int h, graphics::Image const & i)
        QImage const image = qlimage.image();
        QRectF const drect = QRectF(x, y, w, h);
        QRectF const srect = QRectF(0, 0, image.width(), image.height());
+       // Bilinear filtering is needed on a rare occasion for instant previews when
+       // the user's configuration mixes low-dpi and high-dpi monitors (#10114).
+       // This filter is optimised by qt on pixel-aligned images, so this does not
+       // affect performances in other cases.
+       setRenderHint(SmoothPixmapTransform);
        drawImage(drect, image, srect);
+       setRenderHint(SmoothPixmapTransform, false);
 }