浏览代码

Fix some issues.

/main
Yuncong Zhang 5 年前
当前提交
02fa3af6
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 9
      Runtime/ui/renderer/common/geometry/path/path_cache.cs

9
Runtime/ui/renderer/common/geometry/path/path_cache.cs


StrokeCap _lineCap;
StrokeJoin _lineJoin;
float _miterLimit;
float _fringe;
public static uiPathCache create(float scale) {
uiPathCache newPathCache = ObjectPool<uiPathCache>.alloc();

public uiMeshMesh computeStrokeMesh(float strokeWidth, float fringe, StrokeCap lineCap, StrokeJoin lineJoin, float miterLimit) {
if (this._strokeMesh != null &&
this._fillMesh == null && // Ensure that the cached stroke mesh was not calculated in computeFillMesh
this._fringe == fringe &&
this._lineCap == lineCap &&
this._lineJoin == lineJoin &&
this._miterLimit == miterLimit) {

ObjectPool<uiMeshMesh>.release(this._strokeMesh);
this._strokeMesh = uiMeshMesh.create(null, verticesUV.strokeVertices, indices, verticesUV.strokeUV);
ObjectPool<uiMeshMesh>.release(this._fillMesh);
this._fillMesh = null;
this._fringe = fringe;
this._lineCap = lineCap;
this._lineJoin = lineJoin;
this._miterLimit = miterLimit;

public void computeFillMesh(float fringe, out bool convex) {
if (this._fillMesh != null && (fringe != 0.0f || this._strokeMesh != null)) {
if (this._fillMesh != null && (fringe != 0.0f || this._strokeMesh != null) && this._fringe == fringe) {
convex = this._fillConvex;
return;
}

var mesh = uiMeshMesh.create(null, verticesUV.fillVertices, indices, verticesUV.fillUV);
this._fillMesh = mesh;
this._fringe = fringe;
}
}
}
正在加载...
取消
保存