浏览代码

Remove some attributes of Layout.

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

11
Runtime/ui/txt/layout.cs


namespace Unity.UIWidgets.ui {
class Layout {
int _start;
TabStops _tabStops;
static float _x, _y, _maxX, _maxY; // Used to pass bounds from static to non-static doLayout

}
public void doLayout(float offset, TextBuff buff, int start, int count, TextStyle style) {
this._start = start;
public void doLayout(float offset, TextBuff buff, int start, int count, TextStyle style, TabStops tabStops) {
this._tabStops);
tabStops);
this._bounds.Set(_x, _y, _maxX - _x, _maxY - _y);
}

public static void requireEllipsisInTexture(string text, TextStyle style) {
Font font = FontManager.instance.getOrCreate(style.fontFamily, style.fontWeight, style.fontStyle).font;
font.RequestCharactersInTextureSafe(text, style.UnityFontSize, style.UnityFontStyle);
}
public void setTabStops(TabStops tabStops) {
this._tabStops = tabStops;
}
public void allocAdvancesAndPositions(int count) {

3
Runtime/ui/txt/paragraph.cs


float maxWordWidth = 0;
Layout layout = new Layout();
layout.setTabStops(this._tabStops);
TextBlobBuilder builder = new TextBlobBuilder();
GlyphPosition[] glyphPositions = new GlyphPosition[this._text.Length + (this._paragraphStyle.ellipsis?.Length ?? 0)];
int pGlyphPositions = 0;

}
}
layout.doLayout(runXOffset, new TextBuff(text), textStart, textCount, run.style);
layout.doLayout(runXOffset, new TextBuff(text), textStart, textCount, run.style, this._tabStops);
builder.allocRunPos(run.style, text, textStart, textCount);
// bounds relative to first character

正在加载...
取消
保存