|
|
|
|
|
|
return this._states[this._states.Count - 1]; |
|
|
|
} |
|
|
|
|
|
|
|
void _setState(uiCanvasState state) { |
|
|
|
this._states[this._states.Count - 1] = state; |
|
|
|
} |
|
|
|
|
|
|
|
public uiMatrix3 getTotalMatrix() { |
|
|
|
return this._getState().xform; |
|
|
|
} |
|
|
|
|
|
|
paintBounds = state.xform.mapRect(paintBounds); |
|
|
|
this._addPaintBounds(paintBounds); |
|
|
|
} |
|
|
|
this._setState(state); |
|
|
|
break; |
|
|
|
} |
|
|
|
case uiDrawTranslate cmd: { |
|
|
|
|
|
|
this._setState(state); |
|
|
|
break; |
|
|
|
} |
|
|
|
case uiDrawScale cmd: { |
|
|
|
|
|
|
this._setState(state); |
|
|
|
break; |
|
|
|
} |
|
|
|
case uiDrawRotate cmd: { |
|
|
|
|
|
|
cmd.offset.Value.dx, |
|
|
|
cmd.offset.Value.dy); |
|
|
|
} |
|
|
|
this._setState(state); |
|
|
|
break; |
|
|
|
} |
|
|
|
case uiDrawSkew cmd: { |
|
|
|
|
|
|
this._setState(state); |
|
|
|
break; |
|
|
|
} |
|
|
|
case uiDrawConcat cmd: { |
|
|
|
|
|
|
this._setState(state); |
|
|
|
this._setState(state); |
|
|
|
this._setState(state); |
|
|
|
break; |
|
|
|
} |
|
|
|
case uiDrawClipRect cmd: { |
|
|
|
|
|
|
state.scissor = state.scissor == null ? rect : state.scissor.Value.intersect(rect); |
|
|
|
this._setState(state); |
|
|
|
break; |
|
|
|
} |
|
|
|
case uiDrawClipRRect cmd: { |
|
|
|
|
|
|
state.scissor = state.scissor == null ? rect : state.scissor.Value.intersect(rect); |
|
|
|
this._setState(state); |
|
|
|
break; |
|
|
|
} |
|
|
|
case uiDrawClipPath cmd: { |
|
|
|
|
|
|
var transformedMesh = rectMesh.transform(state.xform); |
|
|
|
var rect = transformedMesh.bounds; |
|
|
|
state.scissor = state.scissor == null ? rect : state.scissor.Value.intersect(rect); |
|
|
|
this._setState(state); |
|
|
|
transformedMesh.dispose(); |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
} else { |
|
|
|
state.paintBounds = state.paintBounds.expandToInclude(paintBounds.Value); |
|
|
|
} |
|
|
|
this._setState(state); |
|
|
|
} |
|
|
|
|
|
|
|
struct uiCanvasState { |
|
|
|