浏览代码

Merge branch 'master' of github.com:UnityTech/UIWidgets into dev

# Conflicts:
#	Runtime/ui/painting/picture.cs
/main
xingwei.zhu 5 年前
当前提交
627dd90f
共有 2 个文件被更改,包括 34 次插入16 次删除
  1. 8
      Runtime/ui/painting/canvas.cs
  2. 42
      Runtime/ui/painting/picture.cs

8
Runtime/ui/painting/canvas.cs


}
public void restore() {
this._saveCount--;
this._recorder.addDrawCmd(new DrawRestore {
});
if (this._saveCount > 1) {
this._saveCount--;
this._recorder.addDrawCmd(new DrawRestore {
});
}
}
public int getSaveCount() {

42
Runtime/ui/painting/picture.cs


this._stateUpdateIndices.Clear();
}
void restoreToCount(int count) {
count = this._states.Count - count;
while (count > 0) {
this.addDrawCmd(new DrawRestore());
count--;
}
}
void restore() {
var stateToRestore = this._getState();
this._states.RemoveAt(this._states.Count - 1);
var state = this._getState();
if (!stateToRestore.saveLayer) {
state.paintBounds = stateToRestore.paintBounds;
}
else {
var paintBounds = stateToRestore.paintBounds.shift(stateToRestore.layerOffset);
paintBounds = state.xform.mapRect(paintBounds);
this._addPaintBounds(paintBounds);
}
}
this.restoreToCount(1);
if (this._states.Count > 1) {
throw new Exception("unmatched save/restore commands");
}

}
case DrawRestore _: {
var stateToRestore = this._getState();
this._states.RemoveAt(this._states.Count - 1);
var state = this._getState();
if (!stateToRestore.saveLayer) {
state.paintBounds = stateToRestore.paintBounds;
//check for underflow
if (this._states.Count > 1) {
this.restore();
this._stateUpdateIndices.Add(this._drawCmds.Count - 1);
else {
var paintBounds = stateToRestore.paintBounds.shift(stateToRestore.layerOffset);
paintBounds = state.xform.mapRect(paintBounds);
this._addPaintBounds(paintBounds);
}
this._stateUpdateIndices.Add(this._drawCmds.Count - 1);
break;
}

正在加载...
取消
保存