Unverified Commit e4f08d55 authored by liyuqian's avatar liyuqian Committed by GitHub

Add saveLayer back if there's an overflowShader (#18739)

This should fix https://github.com/flutter/flutter/issues/18729

I'll add a gold test, and try to figure out how to remove the saveLayer without affecting the correctness later.
parent e62626fd
......@@ -355,7 +355,13 @@ class RenderParagraph extends RenderBox {
if (_hasVisualOverflow) {
final Rect bounds = offset & size;
if (_overflowShader != null) {
// This layer limits what the shader below blends with to be just the text
// (as opposed to the text and its background).
canvas.saveLayer(bounds, new Paint());
} else {
canvas.save();
}
canvas.clipRect(bounds);
}
_textPainter.paint(canvas, offset);
......
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