浏览代码

update

/main
gewentao 6 年前
当前提交
56be0e4a
共有 4 个文件被更改,包括 9 次插入10 次删除
  1. 5
      Assets/UIWidgets/Tests/CanvasAndLayers.cs
  2. 6
      Assets/UIWidgets/ui/painting/canvas.cs
  3. 6
      Assets/UIWidgets/ui/painting/canvas_impl.cs
  4. 2
      Assets/UIWidgets/ui/painting/draw_cmd.cs

5
Assets/UIWidgets/Tests/CanvasAndLayers.cs


void drawImageRect()
{
if (_stream == null)
if (_stream == null || _stream.completer == null || _stream.completer._currentImgae == null)
{
return;
}

Rect.fromLTWH(150, 50, 250, 250),
Rect.fromLTWH(150, 50, 250, 250),
paint,
_stream
_stream.completer._currentImgae.image
);
}

paint);
var picture = pictureRecorder.endRecording();
Debug.Log("picture.paintBounds: " + picture.paintBounds);
var editorCanvas = new CanvasImpl();
editorCanvas.concat(Matrix4x4.Rotate(Quaternion.Euler(0, 0, -5)));

6
Assets/UIWidgets/ui/painting/canvas.cs


void drawPicture(Picture picture);
void drawImageRect(Rect src, Rect dst, Paint paint, ImageStream stream);
void drawImageRect(Rect src, Rect dst, Paint paint, Image image);
void concat(Matrix4x4 transform);

});
}
public void drawImageRect(Rect src, Rect dst, Paint paint, ImageStream stream)
public void drawImageRect(Rect src, Rect dst, Paint paint, Image image)
stream = stream,
image = image,
src = src,
dst = dst,
});

6
Assets/UIWidgets/ui/painting/canvas_impl.cs


this.restore();
}
public void drawImageRect(Rect src, Rect dst, Paint paint, ImageStream stream)
public void drawImageRect(Rect src, Rect dst, Paint paint, Image image)
if (stream.completer._currentImgae != null)
if (image != null)
_texture.LoadImage(stream.completer._currentImgae.image.rawData);
_texture.LoadImage(image.rawData);
Graphics.DrawTexture(dst.toRect(), _texture);
}
}

2
Assets/UIWidgets/ui/painting/draw_cmd.cs


public class DrawImageRect : DrawCmd
{
public ImageStream stream;
public Image image;
public Rect src;
public Rect dst;
}

正在加载...
取消
保存