fixed transparent image hero artifact

This commit is contained in:
Thibault Deckers 2021-11-12 16:26:24 +09:00
parent b19d01879f
commit f1aefb2bb1

View file

@ -190,7 +190,8 @@ class _TransitionImagePainter extends CustomPainter {
Offset.zero & inputSize,
);
if (background != null) {
canvas.drawRect(destinationRect, Paint()..color = background!);
// deflate to avoid background artifact around opaque image
canvas.drawRect(destinationRect.deflate(1), Paint()..color = background!);
}
canvas.drawImageRect(image!, sourceRect, destinationRect, paint);
}