Skip to content

Commit

Permalink
Try fixing wxWidgets image scaling issue (SoftFever#2925)
Browse files Browse the repository at this point in the history
  • Loading branch information
Noisyfox committed Nov 29, 2023
1 parent 0fa884d commit 0ae19bf
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions deps/wxWidgets/0001-wxWidget-fix.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;

0 comments on commit 0ae19bf

Please sign in to comment.