Add an adjustment to the line width check in LineBreaker::addWordBreak (#8623)
currentLineWidth is the width passed into Paragraph layout, which comes from the maxIntrinsicWidth returned by a previous call to Paragraph layout. That width is calculated by Layout::measureText. postBreak is calculated from the character widths in the LineBreaker. A slight mismatch between these two widths may unnecessarily cause the insertion of desperate breaks in addWordBreak. Adding some slack to currentLineWidth works around this. Fixes https://github.com/flutter/flutter/issues/30347
Showing
想要评论请 注册 或 登录