浏览代码

Remove substring in invoking _layoutEmoji.

/main
Yuncong Zhang 5 年前
当前提交
62f097a0
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 6
      Runtime/ui/txt/layout.cs

6
Runtime/ui/txt/layout.cs


char startingChar = buff.charAt(start);
if (char.IsHighSurrogate(startingChar) || EmojiUtils.isSingleCharEmoji(startingChar)) {
advance = _layoutEmoji(buff.text.Substring(buff.offset + start, count), style, font, count,
advance = _layoutEmoji(buff.text, buff.offset + start, style, font, count,
advances, positions, advanceOffset, advance);
}
else {

return x;
}
static float _layoutEmoji(string text, TextStyle style, Font font, int count, float[] advances,
static float _layoutEmoji(string text, int start, TextStyle style, Font font, int count, float[] advances,
char c = text[i];
char c = text[start + i];
if (EmojiUtils.isSingleCharNonEmptyEmoji(c) || char.IsHighSurrogate(c)) {
float letterSpace = style.letterSpacing;
float letterSpaceHalfLeft = letterSpace * 0.5f;

正在加载...
取消
保存