|
|
|
|
|
|
using Unity.UIWidgets.gestures; |
|
|
|
using Unity.UIWidgets.painting; |
|
|
|
using Unity.UIWidgets.ui; |
|
|
|
using Gradient = Unity.UIWidgets.ui.Gradient; |
|
|
|
using TextStyle = Unity.UIWidgets.painting.TextStyle; |
|
|
|
|
|
|
|
namespace Unity.UIWidgets.rendering { |
|
|
|
public class RenderProxyBox : RenderProxyBoxMixinRenderObjectWithChildMixinRenderBox<RenderBox> { |
|
|
|
|
|
|
|
|
|
|
protected override void debugPaintSize(PaintingContext context, Offset offset) { |
|
|
|
D.assert(() => { |
|
|
|
// if (this._debugPaint == null) {
|
|
|
|
// this._debugPaint = new Paint();
|
|
|
|
// this._debugPaint.shader = Gradient.linear(
|
|
|
|
// new Offset(0.0, 0.0),
|
|
|
|
// new Offset(10.0, 10.0),
|
|
|
|
// new Color(0x00000000),
|
|
|
|
// new Color(0xFFFF00FF),
|
|
|
|
// TileMode.repeated);
|
|
|
|
// this._debugPaint.strokeWidth = 2.0;
|
|
|
|
// this._debugPaint.style = PaintingStyle.stroke;
|
|
|
|
// }
|
|
|
|
// if (this._debugText == null) {
|
|
|
|
// this._debugText = new TextPainter(
|
|
|
|
// text: new TextSpan(
|
|
|
|
// text: "x",
|
|
|
|
// style: new TextStyle(
|
|
|
|
// color: new Color(0xFFFF00FF),
|
|
|
|
// fontSize: 14.0)
|
|
|
|
// ));
|
|
|
|
// this._debugText.layout();
|
|
|
|
// }
|
|
|
|
if (this._debugPaint == null) { |
|
|
|
this._debugPaint = new Paint(); |
|
|
|
this._debugPaint.shader = Gradient.linear( |
|
|
|
new Offset(0.0f, 0.0f), |
|
|
|
new Offset(10.0f, 10.0f), |
|
|
|
new List<Color> { |
|
|
|
new Color(0x00000000), |
|
|
|
new Color(0xFFFF00FF), |
|
|
|
}, null, TileMode.repeated); |
|
|
|
this._debugPaint.strokeWidth = 2.0f; |
|
|
|
this._debugPaint.style = PaintingStyle.stroke; |
|
|
|
} |
|
|
|
if (this._debugText == null) { |
|
|
|
this._debugText = new TextPainter( |
|
|
|
text: new TextSpan( |
|
|
|
text: "x", |
|
|
|
style: new TextStyle( |
|
|
|
color: new Color(0xFFFF00FF), |
|
|
|
fontSize: 14.0f) |
|
|
|
)); |
|
|
|
this._debugText.layout(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public class RenderClipRect : _RenderCustomClip<Rect> { |
|
|
|
public RenderClipRect( |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public override bool hitTest(HitTestResult result, Offset position = null) { |
|
|
|
D.assert(position != null); |
|
|
|
|
|
|
|
if (this._clipper != null) { |
|
|
|
this._updateClip(); |
|
|
|
D.assert(this._clip != null); |
|
|
|
|
|
|
public override void paint(PaintingContext context, Offset offset) { |
|
|
|
if (this.child != null) { |
|
|
|
this._updateClip(); |
|
|
|
//todo:xingwei.zhu pushClipPath()
|
|
|
|
// context.pushClipPath(this.needsCompositing, offset, Offset.zero & this.size,
|
|
|
|
// this._clip, base.paint, clipBehavior: this.clipBehavior);
|
|
|
|
context.pushClipPath(this.needsCompositing, offset, Offset.zero & this.size, |
|
|
|
this._clip, base.paint, clipBehavior: this.clipBehavior); |
|
|
|
base.paint(context, offset); |
|
|
|
} |
|
|
|
} |
|
|
|