[webs:sketch] do not match bitmap canvases that are too big
diff --git a/lib/web_ui/lib/src/engine/html/picture.dart b/lib/web_ui/lib/src/engine/html/picture.dart index da6f988..e16c252 100644 --- a/lib/web_ui/lib/src/engine/html/picture.dart +++ b/lib/web_ui/lib/src/engine/html/picture.dart
@@ -427,6 +427,12 @@ final double pixelCountRatio = newPixelCount / oldPixelCount; assert(0 <= pixelCountRatio && pixelCountRatio <= 1.0, 'Invalid pixel count ratio $pixelCountRatio'); + + if (pixelCountRatio < 0.25) { + // The old canvas has more than 4x the number of pixels we need. It's best + // to let that canvas be recycled and allocate a smaller one. + return 1.0; + } return 1.0 - pixelCountRatio; } }