improve MapLocationDialog

This commit is contained in:
Syping 2019-07-24 18:35:32 +02:00
parent eee9100d8b
commit 55186e8b88
1 changed files with 5 additions and 2 deletions

View File

@ -61,9 +61,11 @@ MapLocationDialog::~MapLocationDialog()
void MapLocationDialog::drawPointOnMap(double xpos_d, double ypos_d) void MapLocationDialog::drawPointOnMap(double xpos_d, double ypos_d)
{ {
qreal screenRatio = AppEnv::screenRatio(); qreal screenRatio = AppEnv::screenRatio();
int pointMakerSize = 8 * screenRatio; qreal screenRatioPR = AppEnv::screenRatioPR();
int pointMakerSize = 8 * screenRatio * screenRatioPR;
QPixmap pointMakerPixmap = IconLoader::loadingPointmakerIcon().pixmap(QSize(pointMakerSize, pointMakerSize)); QPixmap pointMakerPixmap = IconLoader::loadingPointmakerIcon().pixmap(QSize(pointMakerSize, pointMakerSize));
QSize mapPixelSize = size(); pointMakerPixmap.setDevicePixelRatio(screenRatioPR);
QSize mapPixelSize = QSize(width() * screenRatioPR, height() * screenRatioPR);
int pointMakerHalfSize = pointMakerSize / 2; int pointMakerHalfSize = pointMakerSize / 2;
long xpos_ms = qRound(xpos_d); long xpos_ms = qRound(xpos_d);
@ -82,6 +84,7 @@ void MapLocationDialog::drawPointOnMap(double xpos_d, double ypos_d)
mapPainter.drawPixmap(0, 0, mapPixelSize.width(), mapPixelSize.height(), QPixmap(":/img/mappreview.jpg").scaled(mapPixelSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); mapPainter.drawPixmap(0, 0, mapPixelSize.width(), mapPixelSize.height(), QPixmap(":/img/mappreview.jpg").scaled(mapPixelSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
mapPainter.drawPixmap(xpos_pr, mapPixelSize.height() - ypos_pr, pointMakerSize, pointMakerSize, pointMakerPixmap); mapPainter.drawPixmap(xpos_pr, mapPixelSize.height() - ypos_pr, pointMakerSize, pointMakerSize, pointMakerPixmap);
mapPainter.end(); mapPainter.end();
mapPixmap.setDevicePixelRatio(screenRatioPR);
QPalette backgroundPalette; QPalette backgroundPalette;
backgroundPalette.setBrush(backgroundRole(), QBrush(mapPixmap)); backgroundPalette.setBrush(backgroundRole(), QBrush(mapPixmap));