Commit c9d3217c authored by Adam Barth's avatar Adam Barth

Use Canvas#drawParagraph

We'll eventually remove Paragraph#paint.

Fixes #2694
parent 50a249e3
......@@ -22,7 +22,7 @@ void beginFrame(Duration timeStamp) {
final ui.PictureRecorder recorder = new ui.PictureRecorder();
final ui.Canvas canvas = new ui.Canvas(recorder, physicalBounds);
canvas.scale(devicePixelRatio, devicePixelRatio);
paragraph.paint(canvas, new ui.Offset(
canvas.drawParagraph(paragraph, new ui.Offset(
(logicalSize.width - paragraph.maxIntrinsicWidth) / 2.0,
(logicalSize.height - paragraph.height) / 2.0
));
......
......@@ -21,7 +21,7 @@ ui.Picture paint(ui.Rect paintBounds) {
// The paint method of Pargraph draws the contents of the paragraph unto the
// given canvas.
paragraph.paint(canvas, new ui.Offset(paragraph.maxWidth / -2.0, (paragraph.maxWidth / 2.0) - 125));
canvas.drawParagraph(paragraph, new ui.Offset(paragraph.maxWidth / -2.0, (paragraph.maxWidth / 2.0) - 125));
return recorder.endRecording();
}
......
......@@ -294,7 +294,7 @@ class TextPainter {
/// Paints the text onto the given canvas at the given offset.
void paint(Canvas canvas, Offset offset) {
assert(!_needsLayout && "Please call layout() before paint() to position the text before painting it." is String);
_paragraph.paint(canvas, offset);
canvas.drawParagraph(_paragraph, offset);
}
Offset _getOffsetFromUpstream(int offset, Rect caretPrototype) {
......
......@@ -113,7 +113,7 @@ class RenderErrorBox extends RenderBox {
_paragraph.maxWidth = size.width;
}
_paragraph.layout();
_paragraph.paint(context.canvas, offset);
context.canvas.drawParagraph(_paragraph, offset);
}
} catch (e) { }
}
......
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