mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1109001 - Only set alpha on non-transparent colors in shaped drawable (r=mcomella)
This commit is contained in:
parent
ceba17c93e
commit
b6033299b6
@ -56,11 +56,15 @@ public class ResizablePathDrawable extends ShapeDrawable {
|
||||
protected void onDraw(Shape shape, Canvas canvas, Paint paint) {
|
||||
paint.setColor(currentColor);
|
||||
// setAlpha overrides the alpha value in set color. Since we just set the color,
|
||||
// the alpha value is reset: override the alpha value with the old value.
|
||||
// the alpha value is reset: override the alpha value with the old value. We don't
|
||||
// set alpha if the color is transparent.
|
||||
//
|
||||
// Note: We *should* be able to call Shape.setAlpha, rather than Paint.setAlpha, but
|
||||
// then the opacity doesn't change - dunno why but probably not worth the time.
|
||||
paint.setAlpha(alpha);
|
||||
if (currentColor != Color.TRANSPARENT) {
|
||||
paint.setAlpha(alpha);
|
||||
}
|
||||
|
||||
super.onDraw(shape, canvas, paint);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user