From 7774a43762fd0438be9ea5d3937b054a00720927 Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop Date: Sun, 26 May 2024 13:54:09 +0300 Subject: [PATCH] Fix project tree icons on Windows. --- kicad/project_tree.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kicad/project_tree.cpp b/kicad/project_tree.cpp index e6cc059650..1f9aa3bc61 100644 --- a/kicad/project_tree.cpp +++ b/kicad/project_tree.cpp @@ -131,7 +131,10 @@ void PROJECT_TREE::LoadIcons() else physSize = 24; - double bmpsf = physSize / logicSize; + logicSize = std::min( logicSize, physSize ); + int bmpsf = std::max( 1, physSize / logicSize ); + + logicSize = physSize / bmpsf; auto toBitmap = [&]( BITMAPS aBmps ) {