diff options
author | John Fultz <jfultz@wolfram.com> | 2019-08-11 08:26:26 -0500 |
---|---|---|
committer | John Fultz <jfultz@wolfram.com> | 2019-08-11 08:26:26 -0500 |
commit | 61aa7d337a045759e06803c89b5f364ca4ed26b1 (patch) | |
tree | 697ccd79d7422de0f6223925aed43caa856b8ab3 /quacker/rackdisplay.cpp | |
parent | 5deb07e6f33b1bfa9ea655ee14700dc126f04537 (diff) |
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.
Diffstat (limited to 'quacker/rackdisplay.cpp')
-rw-r--r-- | quacker/rackdisplay.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
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); |