From 99f2a92df4caeb8061b31eb282c120f578bf50c3 Mon Sep 17 00:00:00 2001 From: forbes Date: Wed, 18 Feb 2026 12:52:14 -0600 Subject: [PATCH] fix(gui): make SVG icon rasterization DPI-aware in loadPixmap (#189) loadPixmap() rendered all SVGs at a hardcoded 64x64 pixels regardless of display DPI. On HiDPI screens, Qt then downscaled these low-resolution pixmaps to the toolbar icon size, producing chunky/aliased icons. Multiply the render size by getMaximumDPR() and tag the resulting pixmap with the correct devicePixelRatio, matching the pattern already used in pixmapFromSvg(const char* name, QSizeF size). This ensures SVGs are rasterized at the physical resolution needed for crisp display. --- src/Gui/BitmapFactory.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Gui/BitmapFactory.cpp b/src/Gui/BitmapFactory.cpp index 8333807dea..73383d2e13 100644 --- a/src/Gui/BitmapFactory.cpp +++ b/src/Gui/BitmapFactory.cpp @@ -217,7 +217,9 @@ bool BitmapFactoryInst::loadPixmap(const QString& filename, QPixmap& icon) const QFile svgFile(fi.filePath()); if (svgFile.open(QFile::ReadOnly | QFile::Text)) { QByteArray content = svgFile.readAll(); - icon = pixmapFromSvg(content, QSize(64, 64)); + static qreal dpr = getMaximumDPR(); + icon = pixmapFromSvg(content, QSize(64, 64) * dpr); + icon.setDevicePixelRatio(dpr); } } else {