Add the missing canvas.save and canvas.restore (#18722)

This fixes https://github.com/flutter/flutter/issues/18708
This commit is contained in:
liyuqian
2018-06-22 13:58:46 -07:00
committed by GitHub
parent d6465c477a
commit 7fdb404a13

View File

@@ -1752,8 +1752,10 @@ class RenderPhysicalShape extends _RenderPhysicalModelBase<Path> {
);
}
canvas.drawPath(offsetPath, new Paint()..color = color..style = PaintingStyle.fill);
canvas.save();
canvas.clipPath(offsetPath);
super.paint(context, offset);
canvas.restore();
assert(context.canvas == canvas, 'canvas changed even though needsCompositing was false');
}
}