Clear mLineWidths in LineBreaker::finish()

There was the possibility of stale indents from previous invocations
persisting in the mLineWidths across multiple invocations. This patch
clears them.

Bug: 28090810
Change-Id: I3621dfbe983512046289373711709aeade52eab4
This commit is contained in:
Raph Levien 2016-04-12 15:27:17 -07:00
parent 1ea4165cef
commit 0ae37ab603
2 changed files with 4 additions and 0 deletions

View File

@ -69,6 +69,9 @@ class LineWidths {
}
return width;
}
void clear() {
mIndents.clear();
}
private:
float mFirstWidth;
int mFirstWidthLineCount;

View File

@ -419,6 +419,7 @@ size_t LineBreaker::computeBreaks() {
void LineBreaker::finish() {
mWordBreaker.finish();
mWidth = 0;
mLineWidths.clear();
mCandidates.clear();
mBreaks.clear();
mWidths.clear();