浏览代码

Merge pull request #368 from UnityTech/master

master hotfix
/main
GitHub 5 年前
当前提交
e8e3f552
共有 5 个文件被更改,包括 20 次插入9 次删除
  1. 4
      Runtime/material/input_decorator.cs
  2. 8
      Runtime/ui/txt/paragraph.cs
  3. 11
      Runtime/ui/window.cs
  4. 4
      Runtime/widgets/list_wheel_scroll_view.cs
  5. 2
      Runtime/widgets/sliver.cs

4
Runtime/material/input_decorator.cs


? 0
: this.decoration.floatingLabelHeight;
float topHeight = this.decoration.border.isOutline
? Math.Max(labelHeight - boxToBaseline[this.label], 0)
? Math.Max(labelHeight - boxToBaseline.getOrDefault(this.label, 0), 0)
: boxToBaseline[this.counter] + subtextGap;
: boxToBaseline.getOrDefault(this.counter, 0) + subtextGap;
bool helperErrorExists = this.helperError?.size != null
&& this.helperError.size.height > 0;
float helperErrorHeight = !helperErrorExists

8
Runtime/ui/txt/paragraph.cs


(!ReferenceEquals(item.Value, null) && item.Value.Equals(this.root.Value)));
}
public KeyValuePair<TKey, TValue> First() {
public KeyValuePair<TKey, TValue>? First() {
throw new NullReferenceException("The root of this tree is null!");
return null;
}
while (t.LeftChild != null) {

return new KeyValuePair<TKey, TValue>(t.Key, t.Value);
}
public KeyValuePair<TKey, TValue> Last() {
public KeyValuePair<TKey, TValue>? Last() {
throw new NullReferenceException("The root of this tree is null!");
return null;
}
while (t.RightChild != null) {

11
Runtime/ui/window.cs


using Unity.UIWidgets.editor;
using Unity.UIWidgets.foundation;
using UnityEngine;
using UnityEngine.Rendering;
namespace Unity.UIWidgets.ui {
public delegate void VoidCallback();

public const int defaultMaxTargetFrameRate = 60;
public const int defaultMinTargetFrameRate = 25;
public const int defaultMaxRenderFrameInterval = 100;
public const int defaultMinRenderFrameInterval = 1;
static Action _onFrameRateSpeedUp = defaultFrameRateSpeedUp;

}
static void defaultFrameRateSpeedUp() {
#if UNITY_2019_3_OR_NEWER
OnDemandRendering.renderFrameInterval = defaultMinRenderFrameInterval;
#else
#endif
}
static Action _onFrameRateCoolDown = defaultFrameRateCoolDown;

}
static void defaultFrameRateCoolDown() {
#if UNITY_2019_3_OR_NEWER
OnDemandRendering.renderFrameInterval = defaultMaxRenderFrameInterval;
#else
#endif
}
}
}

4
Runtime/widgets/list_wheel_scroll_view.cs


return;
}
int firstIndex = this._childElements.First().Key;
int lastIndex = this._childElements.Last().Key;
int firstIndex = this._childElements.First()?.Key ?? 0;
int lastIndex = this._childElements.Last()?.Key ?? 0;
for (int index = firstIndex; index <= lastIndex; ++index) {
Element newChild = this.updateChild(this._childElements[index], this.retrieveWidget(index), index);

2
Runtime/widgets/sliver.cs


// processElement may modify the Map - need to do a .toList() here.
this._childElements.Keys.ToList().ForEach(action: processElement);
if (this._didUnderflow) {
var lastKey = this._childElements?.Last().Key ?? -1;
var lastKey = this._childElements?.Last()?.Key ?? -1;
processElement(lastKey + 1);
}
}

正在加载...
取消
保存