mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Add comment to RenderColoredBox.paint() (#72526)
This commit is contained in:
parent
19a835498e
commit
d61d7758ed
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user