From b25e7a849b9d6b26097a16218aa5a1e873d07440 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Sun, 30 Jul 2023 12:11:00 +0300 Subject: [PATCH] scene: Make ImageItem use linear filter and clamp-to-edges wrap mode Use the linear filter to ensure that the cursor doesn't look blocky with some scale factors and use the clamp-to-edge wrap mode to avoid potential artifacts when the image is scaled. --- src/scene/imageitem.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/scene/imageitem.cpp b/src/scene/imageitem.cpp index c0c729b714..66c5d884af 100644 --- a/src/scene/imageitem.cpp +++ b/src/scene/imageitem.cpp @@ -50,6 +50,8 @@ void ImageItemOpenGL::preprocess() if (!m_texture || m_texture->size() != m_image.size()) { m_texture = GLTexture::upload(m_image); + m_texture->setFilter(GL_LINEAR); + m_texture->setWrapMode(GL_CLAMP_TO_EDGE); } else { m_texture->update(m_image); }