浏览代码

Merge pull request #338 from UnityTech/fix_raster_cache_assert

fix raster cache assert issue
/main
GitHub 5 年前
当前提交
1267d13c
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 9
      Runtime/ui/renderer/compositeCanvas/flow/raster_cache.cs

9
Runtime/ui/renderer/compositeCanvas/flow/raster_cache.cs


D.assert(() => {
var textureWidth = Mathf.CeilToInt(bounds.width * this.devicePixelRatio);
var textureHeight = Mathf.CeilToInt(bounds.height * this.devicePixelRatio);
D.assert(this.image.width == textureWidth);
D.assert(this.image.height == textureHeight);
//it is possible that there is a minor difference between the bound size and the image size (1 pixel at
//most) due to the roundOut operation when calculating the bounds if the elements in the canvas transform
//is not all integer
D.assert(Mathf.Abs(this.image.width - textureWidth) <= 1);
D.assert(Mathf.Abs(this.image.height - textureHeight) <= 1);
return true;
});

正在加载...
取消
保存