Commit e8091a1d authored by David Edmundson's avatar David Edmundson

Follow scale of drag surfaces

Summary:
Similar to regular cursors a drag surface can have a scale.

The buffer "rect" should be in logical pixels at which point QPainter
will automatically handle everything.

CCBUG: 421395

Reviewers: #kwin, zzag, apol

Reviewed By: #kwin, zzag, apol

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29672
parent 88c4de60
......@@ -1229,6 +1229,7 @@ void CursorImage::updateDragCursor()
if (additionalIcon.isNull()) {
m_drag.cursor.image = buffer->data().copy();
m_drag.cursor.image.setDevicePixelRatio(cursorSurface->scale());
} else {
QRect cursorRect = buffer->data().rect();
QRect iconRect = additionalIcon.rect();
......@@ -1245,6 +1246,7 @@ void CursorImage::updateDragCursor()
}
m_drag.cursor.image = QImage(cursorRect.united(iconRect).size(), QImage::Format_ARGB32_Premultiplied);
m_drag.cursor.image.setDevicePixelRatio(cursorSurface->scale());
m_drag.cursor.image.fill(Qt::transparent);
QPainter p(&m_drag.cursor.image);
p.drawImage(iconRect, additionalIcon);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment