From 0ae19bf2677b8d2589ef8676cb1f996f93f5c1ad Mon Sep 17 00:00:00 2001 From: Noisyfox Date: Wed, 29 Nov 2023 22:30:59 +0800 Subject: [PATCH] Try fixing wxWidgets image scaling issue (#2925) --- deps/wxWidgets/0001-wxWidget-fix.patch | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/deps/wxWidgets/0001-wxWidget-fix.patch b/deps/wxWidgets/0001-wxWidget-fix.patch index 1104d5d147f..8f51515e047 100644 --- a/deps/wxWidgets/0001-wxWidget-fix.patch +++ b/deps/wxWidgets/0001-wxWidget-fix.patch @@ -667,3 +667,22 @@ index de5f52860c..a9581174a4 100644 return value; // TODO case wxSYS_FRAMESIZE_X: +diff --git "a/src/common/image.cpp" "b/src/common/image.cpp" +index 6360f5a447..fc0f391381 100644 +--- "a/src/common/image.cpp" ++++ "b/src/common/image.cpp" +@@ -390,11 +390,11 @@ wxImage wxImage::ShrinkBy( int xFactor , int yFactor ) const + unsigned char red = pixel[0] ; + unsigned char green = pixel[1] ; + unsigned char blue = pixel[2] ; +- unsigned char alpha = 255 ; +- if ( source_alpha ) +- alpha = *(source_alpha + y_offset + x * xFactor + x1) ; + if ( !hasMask || red != maskRed || green != maskGreen || blue != maskBlue ) + { ++ unsigned char alpha = 255; ++ if ( source_alpha ) ++ alpha = *(source_alpha + y_offset + x * xFactor + x1); + if ( alpha > 0 ) + { + avgRed += red ;