Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

Commit 348e9b7

Browse files
committed
添加一个简单的自适应
1 parent 7f3dd49 commit 348e9b7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Assets/TextInlineSprite/Scripts/InlineText.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,8 +426,9 @@ bool ParseEmoji(string newInfo,int Index, int Id, string TagName, Match match, r
426426

427427
_textBuilder.Append(newInfo.Substring(_textIndex, match.Index - _textIndex));
428428
int _tempIndex = _textBuilder.Length * 4;
429-
430-
_textBuilder.AppendFormat("<quad material=0 x={0} y={1} size={2} width={3} />", tagSprites.x, tagSprites.y, tagSprites.size, tagSprites.width);
429+
430+
float autosize = Mathf.Min(tagSprites.size, this.rectTransform.rect.height);
431+
_textBuilder.AppendFormat("<quad material=0 x={0} y={1} size={2} width={3} />", tagSprites.x, tagSprites.y, autosize, tagSprites.width);
431432

432433
if (RenderTagList.Count > Index)
433434
{

0 commit comments

Comments
 (0)