fix(gui): make SVG icon rasterization DPI-aware in loadPixmap (#189) #266

Merged
forbes merged 2 commits from fix/toolbar-icon-dpi-scaling into main 2026-02-18 18:57:15 +00:00

2 Commits

Author SHA1 Message Date
forbes
ea49736549 test(gui): add BitmapFactory DPI-aware SVG rendering tests (#189)
All checks were successful
Build and Test / build (pull_request) Successful in 29m28s
Three tests for the loadPixmap() DPI fix:
- pixmapFromSvg(content, size) renders at the exact requested size
- getMaximumDPR() returns >= 1.0
- pixmap() loaded from an SVG file has correct devicePixelRatio and
  physical size matching 64 * DPR
2026-02-18 12:54:48 -06:00
forbes
99f2a92df4 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.
2026-02-18 12:52:14 -06:00