cursordelgate: round cursor position when rendering
Otherwise there can be weird artifacts when screen scaling is involved
This commit is contained in:
parent
264a19247b
commit
3334fb8752
1 changed files with 3 additions and 1 deletions
|
@ -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 ®i
|
|||
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue