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.
This commit is contained in:
Vlad Zahorodnii 2023-07-30 12:11:00 +03:00
parent 6a1418c5b1
commit b25e7a849b

View file

@ -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);
}