Unverified Commit d61d7758 authored by Todd Volkert's avatar Todd Volkert Committed by GitHub

Add comment to RenderColoredBox.paint() (#72526)

parent 19a83549
......@@ -7683,6 +7683,10 @@ class _RenderColoredBox extends RenderProxyBoxWithHitTestBehavior {
@override
void paint(PaintingContext context, Offset offset) {
// It's tempting to want to optimize out this `drawRect()` call if the
// color is transparent (alpha==0), but doing so would be incorrect. See
// https://github.com/flutter/flutter/pull/72526#issuecomment-749185938 for
// a good description of why.
if (size > Size.zero) {
context.canvas.drawRect(offset & size, Paint()..color = color);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment