浏览代码

Make some small fixes.

/main
Yuncong Zhang 5 年前
当前提交
406cadb7
共有 2 个文件被更改,包括 1 次插入18 次删除
  1. 17
      Runtime/ui/txt/linebreaker.cs
  2. 2
      Runtime/ui/txt/wordbreaker.cs

17
Runtime/ui/txt/linebreaker.cs


const int kTabSpaceCount = 4;
List<int> _stops = new List<int>();
public void set(List<int> stops, int tabWidth) {
this._stops.Clear();
if (stops != null) {
this._stops.AddRange(stops);
}
this._tabWidth = tabWidth;
}
public void setFont(Font font, int size) {
if (this._font != font || this._fontSize != size) {
this._tabWidth = int.MaxValue;

}
public float nextTab(float widthSoFar) {
for (int i = 0; i < this._stops.Count; i++) {
if (this._stops[i] > widthSoFar) {
return this._stops[i];
}
}
if (this._tabWidth == int.MaxValue) {
if (this._fontSize > 0) {
this._tabWidth = this._spaceAdvance * kTabSpaceCount;

2
Runtime/ui/txt/wordbreaker.cs


namespace Unity.UIWidgets.ui {
class WordBreaker {
struct WordBreaker {
public const uint U16_SURROGATE_OFFSET = ((0xd800 << 10) + 0xdc00 - 0x10000);
TextBuff _text;
int _current;

正在加载...
取消
保存