浏览代码

fix an error in editable.cs

/siyaoH-1.17-PlatformMessage
guanghuispark 4 年前
当前提交
5251b06c
共有 6 个文件被更改,包括 164 次插入66 次删除
  1. 88
      com.unity.uiwidgets/Runtime/rendering/RenderAnimatedOpacityMixin.mixin.gen.cs
  2. 55
      com.unity.uiwidgets/Runtime/rendering/RenderAnimatedOpacityMixin.mixin.njk
  3. 17
      com.unity.uiwidgets/Runtime/rendering/editable.cs
  4. 6
      com.unity.uiwidgets/Runtime/rendering/object.cs
  5. 41
      com.unity.uiwidgets/Runtime/rendering/object.mixin.gen.cs
  6. 23
      com.unity.uiwidgets/Runtime/rendering/object.mixin.njk

88
com.unity.uiwidgets/Runtime/rendering/RenderAnimatedOpacityMixin.mixin.gen.cs


using System;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;
public abstract class RenderAnimatedOpacityMixinRenderSliver<ChildType> : RenderProxySliver, RenderAnimatedOpacityMixin<ChildType> where ChildType : RenderObject {
public int _alpha { get; set; }
public new bool alwaysNeedsCompositing {
public abstract class RenderAnimatedOpacityMixinRenderSliver<ChildType> : RenderProxySliver, RenderAnimatedOpacityMixin<ChildType> where ChildType : RenderObject {
public int _alpha { get; set;}
public new bool alwaysNeedsCompositing {
public bool _currentlyNeedsCompositing { get; set; }
public bool _currentlyNeedsCompositing { get;set; }
public Animation<float> opacity {
get { return _opacity; }

_updateOpacity();
}
}
public bool alwaysIncludeSemantics {
get { return _alwaysIncludeSemantics; }
set {

}
}
public bool _alwaysIncludeSemantics { get; set; }
public override void attach(object owner) {
owner = (PipelineOwner) owner;
base.attach(owner);
_opacity.addListener(_updateOpacity);
_updateOpacity();
}
public bool _alwaysIncludeSemantics { get; set; }
_updateOpacity();
_updateOpacity();
public override void detach() {
_opacity.removeListener(_updateOpacity);
base.detach();

markNeedsPaint();
//if (oldAlpha == 0 || _alpha == 0)
// markNeedsSemanticsUpdate();
}
}
public override void paint(PaintingContext context, Offset offset) {

layer = context.pushOpacity(offset, _alpha, base.paint, oldLayer: layer as OpacityLayer);
}
}
public bool debugValidateChild(RenderObject child) {
D.assert(() => {
if (!(child is ChildType)) {
throw new UIWidgetsError(new List<DiagnosticsNode>{
new ErrorSummary(
$"A {GetType()} expected a child of type {typeof(ChildType)} but received a " +
$"child of type {child.GetType()}."
),
new ErrorDescription(
"RenderObjects expect specific types of children because they " +
"coordinate with their children during layout and paint. For " +
"example, a RenderSliver cannot be the child of a RenderBox because " +
"a RenderSliver does not understand the RenderBox layout protocol."
),
new ErrorSpacer(),
new DiagnosticsProperty<dynamic>(
"The $runtimeType that expected a $ChildType child was created by",
debugCreator,
style: DiagnosticsTreeStyle.errorProperty
),
new ErrorSpacer(),
new DiagnosticsProperty<dynamic>(
"The ${child.runtimeType} that did not match the expected child type " +
"was created by",
child.debugCreator,
style: DiagnosticsTreeStyle.errorProperty
),
});
}
return true;
});
return true;
}
RenderObject RenderObjectWithChildMixin.child {
get { return child; }
set { child = (ChildType) value; }
}
}

55
com.unity.uiwidgets/Runtime/rendering/RenderAnimatedOpacityMixin.mixin.njk


using System.Collections.Generic;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
public abstract class RenderAnimatedOpacityMixin{{with}}<ChildType> : {{with}}, RenderAnimatedOpacityMixin<ChildType> where ChildType : RenderSliver {
public abstract class RenderAnimatedOpacityMixin{{with}}<ChildType> : RenderProxySliver, RenderAnimatedOpacityMixin<ChildType> where ChildType : RenderObject {
get { child != null && _currentlyNeedsCompositing;}
get { return child != null && _currentlyNeedsCompositing;}
}
public bool _currentlyNeedsCompositing { get;set; }

}
public bool _alwaysIncludeSemantics { get; set; }
public override void attach(PipelineOwner owner) {
public void attach(PipelineOwner owner) {
_updateOpacity();
_updateOpacity();
public override void detach() {
_opacity.removeListener(_updateOpacity);
base.detach();

base.debugFillProperties(properties);
properties.add(new DiagnosticsProperty<Animation<float>>("opacity", opacity));
properties.add(new FlagProperty("alwaysIncludeSemantics", value: alwaysIncludeSemantics, ifTrue: "alwaysIncludeSemantics"));
}
public bool debugValidateChild(RenderObject child) {
D.assert(() => {
if (!(child is ChildType)) {
throw new UIWidgetsError(new List<DiagnosticsNode>{
new ErrorSummary(
$"A {GetType()} expected a child of type {typeof(ChildType)} but received a " +
$"child of type {child.GetType()}."
),
new ErrorDescription(
"RenderObjects expect specific types of children because they " +
"coordinate with their children during layout and paint. For " +
"example, a RenderSliver cannot be the child of a RenderBox because " +
"a RenderSliver does not understand the RenderBox layout protocol."
),
new ErrorSpacer(),
new DiagnosticsProperty<dynamic>(
"The $runtimeType that expected a $ChildType child was created by",
debugCreator,
style: DiagnosticsTreeStyle.errorProperty
),
new ErrorSpacer(),
new DiagnosticsProperty<dynamic>(
"The ${child.runtimeType} that did not match the expected child type " +
"was created by",
child.debugCreator,
style: DiagnosticsTreeStyle.errorProperty
),
});
}
return true;
});
return true;
}
public ChildType child { get; set; }
RenderObject RenderObjectWithChildMixin.child {
get { return child; }
set { child = (ChildType) value; }
}
}

17
com.unity.uiwidgets/Runtime/rendering/editable.cs


}
}
public class RenderEditable : RenderBox, RelayoutWhenSystemFontsChangeMixin {
public class RenderEditable : RelayoutWhenSystemFontsChangeMixinRenderBox {
public RenderEditable(
TextSpan text = null,
TextDirection? textDirection = null,

return true;
}
public void attach(PipelineOwner owner) {
_tap = new TapGestureRecognizer(debugOwner: this);
_tap.onTapDown = _handleTapDown;
_tap.onTap = _handleTap;
_longPress = new LongPressGestureRecognizer(debugOwner: this);
_longPress.onLongPress = _handleLongPress;
_offset.addListener(markNeedsLayout);
_showCursor.addListener(markNeedsPaint);
}
string _cachedPlainText;
string _plainText {
get {

public override void attach(object ownerObject) {
base.attach(ownerObject);
attach((PipelineOwner)ownerObject);
/*_tap = new TapGestureRecognizer(debugOwner: this);
_tap = new TapGestureRecognizer(debugOwner: this);
_showCursor.addListener(markNeedsPaint);*/
_showCursor.addListener(markNeedsPaint);
}
public override void detach() {

6
com.unity.uiwidgets/Runtime/rendering/object.cs


RenderObject childAfter(RenderObject child);
}
public interface RelayoutWhenSystemFontsChangeMixin {
void systemFontsDidChange();
void attach(PipelineOwner owner);
void detach();
}
public class UIWidgetsErrorDetailsForRendering : UIWidgetsErrorDetails {
public UIWidgetsErrorDetailsForRendering(
Exception exception = null,

41
com.unity.uiwidgets/Runtime/rendering/object.mixin.gen.cs


using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.widgets;
using UnityEngine;

public bool debugValidateChild(RenderObject child) {
public virtual bool debugValidateChild(RenderObject child) {
D.assert(() => {
if (!(child is ChildType)) {
throw new UIWidgetsError(

public abstract class RenderObjectWithChildMixinRenderBox<ChildType> : RenderBox, RenderObjectWithChildMixin<ChildType>, RenderObjectWithChildMixin where ChildType : RenderObject {
public bool debugValidateChild(RenderObject child) {
public virtual bool debugValidateChild(RenderObject child) {
D.assert(() => {
if (!(child is ChildType)) {
throw new UIWidgetsError(

public virtual void insert(ChildType child, ChildType after = null) {
D.assert(child != this, ()=>"A RenderObject cannot be inserted into itself.");
D.assert(after != this,()=>
"A RenderObject cannot simultaneously be both the parent and the sibling of another RenderObject.");
D.assert(after != this,
()=>"A RenderObject cannot simultaneously be both the parent and the sibling of another RenderObject.");
adoptChild(child);
_insertIntoChildList(child, after);
}

public virtual void insert(ChildType child, ChildType after = null) {
D.assert(child != this, ()=>"A RenderObject cannot be inserted into itself.");
D.assert(after != this,()=>
"A RenderObject cannot simultaneously be both the parent and the sibling of another RenderObject.");
D.assert(after != this,
()=>"A RenderObject cannot simultaneously be both the parent and the sibling of another RenderObject.");
adoptChild(child);
_insertIntoChildList(child, after);
}

public virtual void insert(ChildType child, ChildType after = null) {
D.assert(child != this, ()=>"A RenderObject cannot be inserted into itself.");
D.assert(after != this,
()=> "A RenderObject cannot simultaneously be both the parent and the sibling of another RenderObject.");
D.assert(child != after,()=> "A RenderObject cannot be inserted after itself.");
()=>"A RenderObject cannot simultaneously be both the parent and the sibling of another RenderObject.");
D.assert(child != after, ()=>"A RenderObject cannot be inserted after itself.");
adoptChild(child);
_insertIntoChildList(child, after);
}

invokeLayoutCallback(_callback);
}
}
public abstract class RelayoutWhenSystemFontsChangeMixinRenderBox : RenderBox {
protected void systemFontsDidChange() {
markNeedsLayout();
}
public override void attach(object owner) {
base.attach(owner);
PaintingBinding.instance.systemFonts.addListener(systemFontsDidChange);
}
public override void detach() {
PaintingBinding.instance.systemFonts.removeListener(systemFontsDidChange);
base.detach();
}
}
}

23
com.unity.uiwidgets/Runtime/rendering/object.mixin.njk


using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.widgets;
using UnityEngine;

{{ RenderConstrainedLayoutBuilderMixin('abstract', 'RenderObject', 'Constraints') }}
{{ RenderConstrainedLayoutBuilderMixin('', 'RenderBox', 'BoxConstraints') }}
{{ RenderConstrainedLayoutBuilderMixin('abstract', 'RenderSliver', 'SliverConstraints') }}
{% macro RelayoutWhenSystemFontsChangeMixin(with) %}
public abstract class RelayoutWhenSystemFontsChangeMixin{{with}} : {{with}} {
protected void systemFontsDidChange() {
markNeedsLayout();
}
public override void attach(object owner) {
base.attach(owner);
PaintingBinding.instance.systemFonts.addListener(systemFontsDidChange);
}
public override void detach() {
PaintingBinding.instance.systemFonts.removeListener(systemFontsDidChange);
base.detach();
}
}
{% endmacro %}
{{ RelayoutWhenSystemFontsChangeMixin('RenderBox') }}
}
正在加载...
取消
保存