cursordelgate: round cursor position when rendering

Otherwise there can be weird artifacts when screen scaling is involved
This commit is contained in:
Xaver Hugl 2023-02-20 16:22:24 +01:00
parent 264a19247b
commit 3334fb8752

View file

@ -13,6 +13,8 @@
#include "kwinglutils.h"
#include "scene/cursorscene.h"
#include <cmath>
namespace KWin
{
@ -48,7 +50,7 @@ void CursorDelegateOpenGL::paint(RenderTarget *renderTarget, const QRegion &regi
QMatrix4x4 mvp;
mvp.ortho(QRect(QPoint(0, 0), renderTarget->size()));
mvp.translate(cursorRect.x() * scale, cursorRect.y() * scale);
mvp.translate(std::round(cursorRect.x() * scale), std::round(cursorRect.y() * scale));
GLFramebuffer *fbo = std::get<GLFramebuffer *>(renderTarget->nativeHandle());
GLFramebuffer::pushFramebuffer(fbo);