1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-01-03 13:35:36 +00:00

fix: "Unrecognized colorspace number -1" (#6049)

This commit is contained in:
Charles Kerr 2023-09-29 20:44:59 -05:00 committed by GitHub
parent cf426d8f81
commit aa0ff75c16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -187,7 +187,12 @@ static NSInteger const kMaxPieces = 18 * 18;
}
//it's faster to just set color instead of checking previous color
[bitmap setColor:pieceColor atX:i y:0];
// faster and non-broken alternative to `[bitmap setColor:pieceColor atX:i y:0]`
unsigned char* data = bitmap.bitmapData + (i << 2);
data[0] = pieceColor.redComponent * 255;
data[1] = pieceColor.greenComponent * 255;
data[2] = pieceColor.blueComponent * 255;
data[3] = pieceColor.alphaComponent * 255;
}
free(piecesPercent);
@ -196,7 +201,8 @@ static NSInteger const kMaxPieces = 18 * 18;
//actually draw image
[bitmap drawInRect:barRect fromRect:NSZeroRect operation:NSCompositingOperationSourceOver
fraction:([self.fDefaults boolForKey:@"SmallView"] ? 0.25 : 1.0)respectFlipped:YES
fraction:[self.fDefaults boolForKey:@"SmallView"] ? 0.25 : 1.0
respectFlipped:YES
hints:nil];
}