未验证 提交 4036b260 编写于 作者: D Dan Field 提交者: GitHub

Reset ParagraphBuilder after build() (#7401)

* Reset ParagraphBuilder after build()
上级 4820cbec
......@@ -17,4 +17,11 @@ void main() {
expect(paragraph.width, isNonZero);
expect(paragraph.height, isNonZero);
});
test('PushStyle should not segfault after build()', () {
final ParagraphBuilder paragraphBuilder =
ParagraphBuilder(ParagraphStyle());
paragraphBuilder.build();
paragraphBuilder.pushStyle(TextStyle());
});
}
......@@ -84,6 +84,7 @@ std::unique_ptr<Paragraph> ParagraphBuilder::Build() {
paragraph->SetText(std::move(text_), std::move(runs_));
paragraph->SetParagraphStyle(paragraph_style_);
paragraph->SetFontCollection(font_collection_);
SetParagraphStyle(paragraph_style_);
return paragraph;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册