File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
lib/web_ui/lib/src/engine Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -489,10 +489,11 @@ class BitmapCanvas extends EngineCanvas {
489
489
@override
490
490
void drawParagraph (EngineParagraph paragraph, ui.Offset offset) {
491
491
assert (paragraph._isLaidOut);
492
- html.CanvasRenderingContext2D ctx = _canvasPool.context;
493
492
final ParagraphGeometricStyle style = paragraph._geometricStyle;
494
493
495
494
if (paragraph._drawOnCanvas && _childOverdraw == false ) {
495
+ // !Do not move this assignment above this if clause since, accessing
496
+ // context will generate extra <canvas> tags.
496
497
final List <EngineLineMetrics > lines = paragraph._measurementResult.lines;
497
498
498
499
final SurfacePaintData backgroundPaint = paragraph._background? .paintData;
@@ -503,6 +504,7 @@ class BitmapCanvas extends EngineCanvas {
503
504
}
504
505
505
506
if (style != _cachedLastStyle) {
507
+ html.CanvasRenderingContext2D ctx = _canvasPool.context;
506
508
ctx.font = style.cssFontString;
507
509
_cachedLastStyle = style;
508
510
}
You can’t perform that action at this time.
0 commit comments