浏览代码

make bounds roundOut in raster_cache.

/main
kg 6 年前
当前提交
b5103c52
共有 2 个文件被更改,包括 10 次插入3 次删除
  1. 5
      Runtime/flow/raster_cache.cs
  2. 8
      Runtime/ui/geometry.cs

5
Runtime/flow/raster_cache.cs


public readonly float devicePixelRatio;
public void draw(Canvas canvas) {
var bounds = canvas.getTotalMatrix().mapRect(this.logicalRect).roundOut();
var bounds = canvas.getTotalMatrix().mapRect(this.logicalRect).roundOut(this.devicePixelRatio);
D.assert(() => {
var textureWidth = Mathf.CeilToInt(bounds.width * this.devicePixelRatio);

D.assert(this.image.height == textureHeight);
return true;
});
canvas.save();
try {

RasterCacheResult _rasterizePicture(Picture picture, Matrix3 transform, float devicePixelRatio,
MeshPool meshPool) {
var bounds = transform.mapRect(picture.paintBounds).roundOut();
var bounds = transform.mapRect(picture.paintBounds).roundOut(devicePixelRatio);
var desc = new RenderTextureDescriptor(
Mathf.CeilToInt((bounds.width * devicePixelRatio)),

8
Runtime/ui/geometry.cs


Mathf.Ceil(this.right), Mathf.Ceil(this.bottom));
}
public Rect roundOut(float devicePixelRatio) {
return fromLTRB(
Mathf.Floor(this.left * devicePixelRatio) / devicePixelRatio,
Mathf.Floor(this.top * devicePixelRatio) / devicePixelRatio,
Mathf.Ceil(this.right * devicePixelRatio) / devicePixelRatio,
Mathf.Ceil(this.bottom * devicePixelRatio) / devicePixelRatio);
}
public Rect roundIn() {
return fromLTRB(
Mathf.Ceil(this.left), Mathf.Ceil(this.top),

正在加载...
取消
保存