FlatSVGIcon: if icon has color filter and did change the color, then do not apply global color filter

This commit is contained in:
Karl Tauber
2021-04-16 23:25:22 +02:00
parent 34861166e8
commit ec2fccbb0e

View File

@@ -702,10 +702,14 @@ public class FlatSVGIcon
} }
private Color filterColor( Color color ) { private Color filterColor( Color color ) {
if( colorFilter != null ) if( colorFilter != null ) {
color = colorFilter.filter( color ); Color newColor = colorFilter.filter( color );
if( globalColorFilter != null ) color = (newColor != color)
? newColor
: globalColorFilter.filter( color );
} else
color = globalColorFilter.filter( color ); color = globalColorFilter.filter( color );
if( grayFilter != null ) { if( grayFilter != null ) {
int oldRGB = color.getRGB(); int oldRGB = color.getRGB();
int newRGB = grayFilter.filterRGB( 0, 0, oldRGB ); int newRGB = grayFilter.filterRGB( 0, 0, oldRGB );