scenes/opengl: Properly render cursors with hidpi
GLTexture::width() and GLTexture::height() return the size of the cursor texture in native pixels, but we need a size in device independent pixels. CCBUG: 424589
This commit is contained in:
parent
64b7cc3cf3
commit
6b940c1280
1 changed files with 2 additions and 1 deletions
|
@ -585,8 +585,9 @@ void SceneOpenGL2::paintCursor()
|
|||
}
|
||||
|
||||
// get cursor position in projection coordinates
|
||||
const qreal scale = cursor->image().devicePixelRatio();
|
||||
const QPoint cursorPos = cursor->pos() - cursor->hotspot();
|
||||
const QRect cursorRect(0, 0, m_cursorTexture->width(), m_cursorTexture->height());
|
||||
const QRect cursorRect(QPoint(0, 0), m_cursorTexture->size() / scale);
|
||||
QMatrix4x4 mvp = m_projectionMatrix;
|
||||
mvp.translate(cursorPos.x(), cursorPos.y());
|
||||
|
||||
|
|
Loading…
Reference in a new issue