From 61aa7d337a045759e06803c89b5f364ca4ed26b1 Mon Sep 17 00:00:00 2001 From: John Fultz Date: Sun, 11 Aug 2019 08:26:26 -0500 Subject: Fix devicePixelRatios on tile pixmap after dragging it. Apparently, when you serialize a pixmap through a QDataStream(), it loses track of its devicePixelRatio setting. End rule was that if, on a HiDpi screen, you dragged and dropped a tile within the rack, you'd get a tile that was larger than it should have been by a factor of the default pixel ratio. Solution is to simply reapply the pixel ratio to the newly created Pixmap after deserializing it in the drag-drop code. --- quacker/rackdisplay.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/quacker/rackdisplay.cpp b/quacker/rackdisplay.cpp index 744cd34..59b91e7 100644 --- a/quacker/rackdisplay.cpp +++ b/quacker/rackdisplay.cpp @@ -187,6 +187,7 @@ GraphicalRack::dropEvent (QDropEvent* event) QPoint sourcePos; QPoint offset; dataStream >> pixmap >> sourcePos >> offset; + pixmap.setDevicePixelRatio(devicePixelRatio()); QLabel* droppedTile = new QLabel; droppedTile->setPixmap(pixmap); -- cgit v1.2.3