未验证 提交 68b5337d 编写于 作者: S Srujan Gaddam 提交者: GitHub

Add null checks for CanvasElement attributes (#20580)

Changes in processing compatibility info in dart:html requires
these getters to be null-checked.
上级 38a30296
......@@ -291,8 +291,8 @@ void _debugPrintSurfaceStats(PersistedScene scene, int frameNumber) {
final int pixelCount = canvasElements
.cast<html.CanvasElement>()
.map<int>((html.CanvasElement e) {
final int pixels = e.width * e.height;
canvasInfo.writeln(' - ${e.width} x ${e.height} = $pixels pixels');
final int pixels = e.width! * e.height!;
canvasInfo.writeln(' - ${e.width!} x ${e.height!} = $pixels pixels');
return pixels;
}).fold(0, (int total, int pixels) => total + pixels);
final double physicalScreenWidth =
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册