浏览代码

fix canvas in sceneview.

/main
kg 6 年前
当前提交
7aa75349
共有 3 个文件被更改,包括 26 次插入27 次删除
  1. 13
      Assets/UIWidgets/Tests/SceneViewTests.cs
  2. 31
      Assets/UIWidgets/Tests/Widgets.cs
  3. 9
      Assets/UIWidgets/ui/painting/canvas_impl.cs

13
Assets/UIWidgets/Tests/SceneViewTests.cs


}
public static Widget eventsPage() {
return new Container(
color: CLColors.primary,
margin: EdgeInsets.all(50),
child:new Text(
"Today",
style: new TextStyle(
fontSize: 34,
color: CLColors.white
)
)
);
//return new EventsWaterfallScreen();
return new EventsWaterfallScreen();
}
public static RenderBox flex() {

31
Assets/UIWidgets/Tests/Widgets.cs


Widget _buildHeader(BuildContext context) {
return new Container(
padding: EdgeInsets.only(left: 16.0, right: 8.0),
color: CLColors.blue,
height: headerHeight - _offsetY,
child: new Row(
children: new List<Widget> {

return true;
},
child: new Flexible(
child: ListView.builder(
itemCount: 20,
itemExtent: 100,
physics: new AlwaysScrollableScrollPhysics(),
itemBuilder: (BuildContext context1, int index) => {
return new Container(
color: Color.fromARGB(255, (index * 10) % 256, (index * 10) % 256, (index * 10) % 256)
);
}
child: new Container(
color: CLColors.green,
child: ListView.builder(
itemCount: 20,
itemExtent: 100,
physics: new AlwaysScrollableScrollPhysics(),
itemBuilder: (BuildContext context1, int index) => {
return new Container(
color: Color.fromARGB(255, (index * 10) % 256, (index * 20) % 256,
(index * 30) % 256)
);
}
)
)
)
);

color: CLColors.background1,
child: new Container(
color: CLColors.background1,
child: new Column(
children: new List<Widget> {
this._buildHeader(context),
child: new Column(
children: new List<Widget> {
this._buildHeader(context),
}
}
)
)
);

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


private ClipRec _clipRec;
private LayerRec _layerRec;
private Stack<CanvasRec> _stack;
private RenderTexture _defaultTexture;
private Stack<CanvasRec> stack {
get { return this._stack ?? (this._stack = new Stack<CanvasRec>()); }

1.0f / EditorGUIUtility.pixelsPerPoint,
1.0f / EditorGUIUtility.pixelsPerPoint,
1.0f));
this._defaultTexture = RenderTexture.active;
}
public void drawPloygon4(Offset[] points, Paint paint) {

GL.End();
}
}
public void drawRect(Rect rect, BorderWidth borderWidth, BorderRadius borderRadius, Paint paint) {
this.prepareGL(CanvasImpl.guiRoundedRectMat);

RenderTextureFormat.ARGB32, RenderTextureReadWrite.sRGB);
RenderTexture.active = texture;
GL.PushMatrix();
GL.LoadPixelMatrix((float) bounds.left, (float) bounds.right, (float) bounds.bottom, (float) bounds.top);
GL.Clear(true, true, new UnityEngine.Color(0, 0, 0, 0));

this._layerRec = state.layerRec;
if (layerRec != this._layerRec) {
RenderTexture.active = this._layerRec != null ? this._layerRec.texture : null;
var targetTexture = this._layerRec != null ? this._layerRec.texture : this._defaultTexture;
RenderTexture.active = targetTexture;
GL.PopMatrix();
this.prepareGL(CanvasImpl.guiTextureClipMat);

正在加载...
取消
保存