From c86ed96433a60a7e4e35c36336bdf779ed0d351c Mon Sep 17 00:00:00 2001 From: James Turner Date: Thu, 28 Jun 2018 12:05:49 +0100 Subject: [PATCH] Fix a compilation issue reported by Dany --- src/GUI/BaseDiagram.cxx | 3 ++- src/GUI/PixmapImageItem.cxx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/GUI/BaseDiagram.cxx b/src/GUI/BaseDiagram.cxx index 2e25472c5..e1c9e5238 100644 --- a/src/GUI/BaseDiagram.cxx +++ b/src/GUI/BaseDiagram.cxx @@ -366,7 +366,8 @@ void BaseDiagram::paintNavaid(QPainter* painter, const FGPositionedRef &pos) if (drawAsIcon) { QPixmap pm = iconForPositioned(pos); QPointF loc = m_viewportTransform.map(project(pos->geod())); - iconRect = pm.rect(); + const auto sz = pm.size() / pm.devicePixelRatio(); + iconRect = QRect(QPoint(0,0), sz); iconRect.moveCenter(loc.toPoint()); painter->drawPixmap(iconRect, pm); } diff --git a/src/GUI/PixmapImageItem.cxx b/src/GUI/PixmapImageItem.cxx index 11d609078..6a849ab4e 100644 --- a/src/GUI/PixmapImageItem.cxx +++ b/src/GUI/PixmapImageItem.cxx @@ -44,7 +44,7 @@ void PixmapImageItem::setImage(QImage img) _image = img; update(); - const auto sz = img.size() / img.devicePixelRatioF(); + const auto sz = img.size() / img.devicePixelRatio(); setImplicitSize(sz.width(), sz.height()); emit imageChanged(); }