Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

Commit 4920b6e

Browse files
author
Yuncong Zhang
committed
Clear paragraph as released.
1 parent 77d9edb commit 4920b6e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Runtime/ui/txt/paragraph.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,32 @@ public static Paragraph create() {
260260

261261
public static void release(ref Paragraph paragraph) {
262262
if (paragraph != null) {
263+
paragraph.clear();
263264
_paragraphPool.Add(paragraph);
264265
paragraph = null;
265266
}
266267
}
267268

269+
public void clear() {
270+
this._needsLayout = true;
271+
this._maxIntrinsicWidth = default;
272+
this._minIntrinsicWidth = default;
273+
this._alphabeticBaseline = default;
274+
this._ideographicBaseline = default;
275+
this._lineCount = default;
276+
this._paintRecordsCount = default;
277+
this._codeUnitRunsCount = default;
278+
this._lineRangeCount = default;
279+
this._lineWidthCount = default;
280+
this._didExceedMaxLines = default;
281+
this._width = default;
282+
this._text = default;
283+
this._ellipsizedText = default;
284+
this._ellipsizedLength = default;
285+
this._runs = null;
286+
this._paragraphStyle = null;
287+
}
288+
268289
readonly Paint _textPaint = new Paint {
269290
filterMode = FilterMode.Bilinear
270291
};

0 commit comments

Comments
 (0)