浏览代码

Merge pull request #50 from Unity-Technologies/constrainedlayoutbuildermixin

fix .njk for RenderConstrainedLayoutBuilderMixin
/siyaoH-1.17-PlatformMessage
GitHub 4 年前
当前提交
245ff151
共有 31 个文件被更改,包括 248 次插入191 次删除
  1. 12
      com.unity.uiwidgets/Runtime/cupertino/action_Sheet.cs
  2. 12
      com.unity.uiwidgets/Runtime/cupertino/dialog.cs
  3. 6
      com.unity.uiwidgets/Runtime/rendering/box.cs
  4. 10
      com.unity.uiwidgets/Runtime/rendering/box.mixin.gen.cs
  5. 31
      com.unity.uiwidgets/Runtime/rendering/box.mixin.njk
  6. 6
      com.unity.uiwidgets/Runtime/rendering/custom_layout.cs
  7. 6
      com.unity.uiwidgets/Runtime/rendering/editable.cs
  8. 2
      com.unity.uiwidgets/Runtime/rendering/error.cs
  9. 6
      com.unity.uiwidgets/Runtime/rendering/flex.cs
  10. 6
      com.unity.uiwidgets/Runtime/rendering/image.cs
  11. 6
      com.unity.uiwidgets/Runtime/rendering/list_body.cs
  12. 6
      com.unity.uiwidgets/Runtime/rendering/list_wheel_viewport.cs
  13. 6
      com.unity.uiwidgets/Runtime/rendering/lottie.cs
  14. 60
      com.unity.uiwidgets/Runtime/rendering/object.mixin.gen.cs
  15. 27
      com.unity.uiwidgets/Runtime/rendering/object.mixin.njk
  16. 6
      com.unity.uiwidgets/Runtime/rendering/paragraph.cs
  17. 6
      com.unity.uiwidgets/Runtime/rendering/performance_overlay.cs
  18. 30
      com.unity.uiwidgets/Runtime/rendering/proxy_box.cs
  19. 6
      com.unity.uiwidgets/Runtime/rendering/proxy_box.mixin.gen.cs
  20. 33
      com.unity.uiwidgets/Runtime/rendering/proxy_box.mixin.njk
  21. 6
      com.unity.uiwidgets/Runtime/rendering/rotated_box.cs
  22. 30
      com.unity.uiwidgets/Runtime/rendering/shifted_box.cs
  23. 6
      com.unity.uiwidgets/Runtime/rendering/stack.cs
  24. 6
      com.unity.uiwidgets/Runtime/rendering/table.cs
  25. 6
      com.unity.uiwidgets/Runtime/rendering/viewport.cs
  26. 6
      com.unity.uiwidgets/Runtime/rendering/wrap.cs
  27. 59
      com.unity.uiwidgets/Runtime/widgets/layout_builder.cs
  28. 6
      com.unity.uiwidgets/Runtime/widgets/overlay.cs
  29. 6
      com.unity.uiwidgets/Runtime/widgets/single_child_scroll_view.cs
  30. 7
      com.unity.uiwidgets/Runtime/widgets/sliver_layout_builder.cs
  31. 18
      com.unity.uiwidgets/Scripts/cmds/codegen.js

12
com.unity.uiwidgets/Runtime/cupertino/action_Sheet.cs


return value;
}
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
float contentHeight = contentSection.getMinIntrinsicHeight(width);
float actionsHeight = actionsSection.getMinIntrinsicHeight(width);
bool hasDivider = contentHeight > 0.0f && actionsHeight > 0.0f;

}
}
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
if (childCount == 0) {
return 0.0f;
}

12
com.unity.uiwidgets/Runtime/cupertino/dialog.cs


return value;
}
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
float contentHeight = contentSection.getMinIntrinsicHeight(width);
float actionsHeight = actionsSection.getMinIntrinsicHeight(width);
bool hasDivider = contentHeight > 0.0f && actionsHeight > 0.0f;

}
}
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
float minHeight;
if (childCount == 0) {
minHeight = 0.0f;

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


return _computeIntrinsicDimension(_IntrinsicDimension.minWidth, height, computeMinIntrinsicWidth);
}
protected virtual float computeMinIntrinsicWidth(float height) {
protected internal virtual float computeMinIntrinsicWidth(float height) {
return 0.0f;
}

return _computeIntrinsicDimension(_IntrinsicDimension.maxWidth, height, computeMaxIntrinsicWidth);
}
protected virtual float computeMaxIntrinsicWidth(float height) {
protected internal virtual float computeMaxIntrinsicWidth(float height) {
return 0.0f;
}

computeMinIntrinsicHeight);
}
protected virtual float computeMinIntrinsicHeight(float width) {
protected internal virtual float computeMinIntrinsicHeight(float width) {
return 0.0f;
}

10
com.unity.uiwidgets/Runtime/rendering/box.mixin.gen.cs


using System.Collections.Generic;
using UnityEngine;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.foundation;

}
public bool defaultHitTestChildren(BoxHitTestResult result, Offset position) {
// the x, y parameters have the top left of the node's box as the origin
ChildType child = lastChild;
while (child != null) {
ParentDataType childParentData = child.parentData as ParentDataType;

return child.hitTest(boxHitTestResult, position: transformed);
}
);
if (isHit)
child = childParentData.previousSibling;
}
if (isHit)
return true;
child = childParentData.previousSibling;
}
return false;
}

31
com.unity.uiwidgets/Runtime/rendering/box.mixin.njk


using System.Collections.Generic;
using UnityEngine;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.rendering {

}
}
public bool defaultHitTestChildren(BoxHitTestResult result, Offset position) {
// the x, y parameters have the top left of the node's box as the origin
ChildType child = lastChild;
public bool defaultHitTestChildren(BoxHitTestResult result, Offset position) {
ChildType child = this.lastChild;
ParentDataType childParentData = child.parentData as ParentDataType;
bool isHit = result.addWithPaintOffset(
offset: childParentData.offset,
position: position,
hitTest: (BoxHitTestResult boxHitTestResult, Offset transformed) => {
D.assert(transformed == position - childParentData.offset);
return child.hitTest(boxHitTestResult, position: transformed);
}
);
if (isHit)
child = childParentData.previousSibling;
ParentDataType childParentData = child.parentData as ParentDataType;
bool isHit = result.addWithPaintOffset(
offset: childParentData.offset,
position: position,
hitTest: (BoxHitTestResult boxHitTestResult, Offset transformed) => {
D.assert(transformed == position - childParentData.offset);
return child.hitTest(boxHitTestResult, position: transformed);
}
);
if (isHit)
return true;
child = childParentData.previousSibling;
}
return false;
}

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


return constraints.constrain(_delegate.getSize(constraints));
}
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
float width = _getSize(BoxConstraints.tightForFinite(height: height)).width;
if (width.isFinite()) {
return width;

}
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
float width = _getSize(BoxConstraints.tightForFinite(height: height)).width;
if (width.isFinite()) {
return width;

}
protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
float height = _getSize(BoxConstraints.tightForFinite(width: width)).height;
if (height.isFinite()) {
return height;

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


return rect.shift(_getPixelPerfectCursorOffset(rect));
}
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
_layoutText(float.PositiveInfinity);
return _textPainter.maxIntrinsicWidth + cursorWidth;
}

return Mathf.Max(preferredLineHeight, _textPainter.height);
}
protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
return _preferredHeight(width);
}

2
com.unity.uiwidgets/Runtime/rendering/error.cs


string message;
Paragraph _paragraph;
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
return rendering_._kMaxWidth;
}

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


}
}
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
return _getIntrinsicSize(
sizingDirection: Axis.horizontal,
extent: height,

protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
return _getIntrinsicSize(
sizingDirection: Axis.horizontal,
extent: height,

protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
return _getIntrinsicSize(
sizingDirection: Axis.vertical,
extent: width,

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


));
}
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
D.assert(height >= 0.0);
if (_width == null && _height == null) {
return 0.0f;

}
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
D.assert(width >= 0.0);
if (_width == null && _height == null) {
return 0.0f;

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


}
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
switch (mainAxis) {
case Axis.horizontal:
return _getIntrinsicMainAxis((RenderBox child) => child.getMinIntrinsicWidth(height));

}
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
switch (mainAxis) {
case Axis.horizontal:
return _getIntrinsicMainAxis((RenderBox child) => child.getMaxIntrinsicWidth(height));

}
protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
switch (mainAxis) {
case Axis.horizontal:
return _getIntrinsicMainAxis((RenderBox child) => child.getMinIntrinsicHeight(width));

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


return extent;
}
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
if (childManager.childCount == null) {
return 0.0f;
}

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


return constraints.smallest;
}
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
D.assert(height >= 0.0);
if (_width == null && _height == null) {
return 0.0f;

}
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
D.assert(width >= 0.0);
if (_width == null && _height == null) {
return 0.0f;

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


using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.widgets;
using UnityEngine;
namespace Unity.UIWidgets.rendering {

public abstract class RenderObjectWithChildMixinRenderSliver<ChildType> : RenderSliver, 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 abstract class RenderConstrainedLayoutBuilderMixinRenderObject<ConstraintType, ChildType> : RenderObjectWithChildMixinRenderObject<ChildType>,
RenderConstrainedLayoutBuilder<ConstraintType, ChildType>
where ConstraintType : Constraints
where ChildType : RenderObject {
public LayoutCallback<ConstraintType> _callback { get; set; }
public void updateCallback(LayoutCallback<ConstraintType> value) {
if (value == _callback)
return;
_callback = value;
markNeedsLayout();
}
public void layoutAndBuildChild() {
D.assert(_callback != null);
invokeLayoutCallback(_callback);
}
}
public class RenderConstrainedLayoutBuilderMixinRenderBox<ConstraintType, ChildType> : RenderObjectWithChildMixinRenderBox<ChildType>,
RenderConstrainedLayoutBuilder<ConstraintType, ChildType>
where ConstraintType : BoxConstraints
where ChildType : RenderBox {
public LayoutCallback<ConstraintType> _callback { get; set; }
public void updateCallback(LayoutCallback<ConstraintType> value) {
if (value == _callback)
return;
_callback = value;
markNeedsLayout();
}
public void layoutAndBuildChild() {
D.assert(_callback != null);
invokeLayoutCallback(_callback);
}
}
public abstract class RenderConstrainedLayoutBuilderMixinRenderSliver<ConstraintType, ChildType> : RenderObjectWithChildMixinRenderSliver<ChildType>,
RenderConstrainedLayoutBuilder<ConstraintType, ChildType>
where ConstraintType : SliverConstraints
where ChildType : RenderSliver {
public LayoutCallback<ConstraintType> _callback { get; set; }
public void updateCallback(LayoutCallback<ConstraintType> value) {
if (value == _callback)
return;
_callback = value;
markNeedsLayout();
}
public void layoutAndBuildChild() {
D.assert(_callback != null);
invokeLayoutCallback(_callback);
}
}
}

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


using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.widgets;
public bool debugValidateChild(RenderObject child) {
public virtual bool debugValidateChild(RenderObject child) {
D.assert(() => {
if (!(child is ChildType)) {
throw new UIWidgetsError(

D.assert(child != after, ()=>"A RenderObject cannot be inserted after itself.");
D.assert(child != _firstChild);
D.assert(child != _lastChild);
adoptChild(child);
_insertIntoChildList(child, after);
}

{{ ContainerRenderObjectMixin('RenderProxyBoxMixinRenderObjectWithChildMixinRenderBoxRenderStack') }}
{% macro RenderConstrainedLayoutBuilderMixin(abstract, with, constraint) %}
public {{abstract}} class RenderConstrainedLayoutBuilderMixin{{with}}<ConstraintType, ChildType> : RenderObjectWithChildMixin{{with}}<ChildType>,
RenderConstrainedLayoutBuilder<ConstraintType, ChildType>
where ConstraintType : {{constraint}}
where ChildType : {{with}} {
public LayoutCallback<ConstraintType> _callback { get; set; }
public void updateCallback(LayoutCallback<ConstraintType> value) {
if (value == _callback)
return;
_callback = value;
markNeedsLayout();
}
public void layoutAndBuildChild() {
D.assert(_callback != null);
invokeLayoutCallback(_callback);
}
}
{% endmacro %}
{{ RenderConstrainedLayoutBuilderMixin('abstract', 'RenderObject', 'Constraints') }}
{{ RenderConstrainedLayoutBuilderMixin('', 'RenderBox', 'BoxConstraints') }}
{{ RenderConstrainedLayoutBuilderMixin('abstract', 'RenderSliver', 'SliverConstraints') }}
}

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


get { return _textPainter.size; }
}
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
_layoutText();
return _textPainter.maxIntrinsicWidth;
}

return _textPainter.height;
}
protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
return _computeIntrinsicHeight(width);
}

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


get { return true; }
}
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
return 0.0f;
}

}
}
protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
return _intrinsicHeight;
}

30
com.unity.uiwidgets/Runtime/rendering/proxy_box.cs


BoxConstraints _additionalConstraints;
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
if (_additionalConstraints.hasBoundedWidth && _additionalConstraints.hasTightWidth) {
return _additionalConstraints.minWidth;
}

return width;
}
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
if (_additionalConstraints.hasBoundedWidth && _additionalConstraints.hasTightWidth) {
return _additionalConstraints.minWidth;
}

return width;
}
protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
if (_additionalConstraints.hasBoundedHeight && _additionalConstraints.hasTightHeight) {
return _additionalConstraints.minHeight;
}

float _aspectRatio;
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
if (height.isFinite()) {
return height * _aspectRatio;
}

return 0.0f;
}
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
if (height.isFinite()) {
return height * _aspectRatio;
}

return 0.0f;
}
protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
if (width.isFinite()) {
return width / _aspectRatio;
}

return (input / step.Value).ceil() * step.Value;
}
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
if (child == null) {
return 0.0f;
}

}
protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
if (child == null) {
return 0.0f;
}

) : base(child) {
}
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
if (child == null) {
return 0.0f;
}

return child.getMinIntrinsicWidth(height);
}
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
if (child == null) {
return 0.0f;
}

return child.getMaxIntrinsicWidth(height);
}
protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
return computeMaxIntrinsicHeight(width);
}

bool _offstage;
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
if (offstage) {
return 0.0f;
}

protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
if (offstage) {
return 0.0f;
}

protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
if (offstage) {
return 0.0f;
}

6
com.unity.uiwidgets/Runtime/rendering/proxy_box.mixin.gen.cs


}
}
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
if (child != null) {
return child.getMinIntrinsicWidth(height);
}

protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
if (child != null) {
return child.getMaxIntrinsicWidth(height);
}

protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
if (child != null) {
return child.getMinIntrinsicHeight(width);
}

33
com.unity.uiwidgets/Runtime/rendering/proxy_box.mixin.njk


}
}
protected override float computeMinIntrinsicWidth(float height) {
if (child != null) {
return child.getMinIntrinsicWidth(height);
protected internal override float computeMinIntrinsicWidth(float height) {
if (this.child != null) {
return this.child.getMinIntrinsicWidth(height);
protected override float computeMaxIntrinsicWidth(float height) {
if (child != null) {
return child.getMaxIntrinsicWidth(height);
protected internal override float computeMaxIntrinsicWidth(float height) {
if (this.child != null) {
return this.child.getMaxIntrinsicWidth(height);
protected override float computeMinIntrinsicHeight(float width) {
if (child != null) {
return child.getMinIntrinsicHeight(width);
protected internal override float computeMinIntrinsicHeight(float width) {
if (this.child != null) {
return this.child.getMinIntrinsicHeight(width);
protected override internal float computeMaxIntrinsicHeight(float width) {
if (child != null) {
return child.getMaxIntrinsicHeight(width);
protected internal override float computeMaxIntrinsicHeight(float width) {
if (this.child != null) {
return this.child.getMaxIntrinsicHeight(width);
return 0.0f;
}

protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
if (child != null) {
return child.hitTest(result, position);
}
return false;

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


get { return quarterTurns % 2 == 1; }
}
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
if (child == null) {
return 0.0f;
}

: child.getMinIntrinsicWidth(height);
}
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
if (child == null) {
return 0.0f;
}

: child.getMaxIntrinsicWidth(height);
}
protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
if (child == null) {
return 0.0f;
}

30
com.unity.uiwidgets/Runtime/rendering/shifted_box.cs


this.child = child;
}
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
if (child != null) {
return child.getMinIntrinsicWidth(height);
}

protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
if (child != null) {
return child.getMaxIntrinsicWidth(height);
}

protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
if (child != null) {
return child.getMinIntrinsicHeight(width);
}

EdgeInsets _padding;
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
if (child != null) {
return child.getMinIntrinsicWidth(Mathf.Max(0.0f, height - _padding.vertical)) +
_padding.horizontal;

}
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
if (child != null) {
return child.getMaxIntrinsicWidth(Mathf.Max(0.0f, height - _padding.vertical)) +
_padding.horizontal;

}
protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
if (child != null) {
return child.getMinIntrinsicHeight(Mathf.Max(0.0f, width - _padding.horizontal)) +
_padding.vertical;

public Size _requestedSize;
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
return _requestedSize.height;
}

);
}
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
float result;
if (child == null) {
result = base.computeMinIntrinsicWidth(height);

return result / (_widthFactor ?? 1.0f);
}
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
float result;
if (child == null) {
result = base.computeMaxIntrinsicWidth(height);

return result / (_widthFactor ?? 1.0f);
}
protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
float result;
if (child == null) {
result = base.computeMinIntrinsicHeight(width);

}
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
float width = _getSize(BoxConstraints.tightForFinite(height: height)).width;
if (width.isFinite()) {
return width;

}
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
float width = _getSize(BoxConstraints.tightForFinite(height: height)).width;
if (width.isFinite()) {
return width;

}
protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
float height = _getSize(BoxConstraints.tightForFinite(width: width)).height;
if (height.isFinite()) {
return height;

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


return extent;
}
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
return _getIntrinsicDimension((RenderBox child) => child.getMinIntrinsicHeight(width));
}

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


}
}
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
D.assert(_children.Count == rows * columns);
float totalMinWidth = 0.0f;
for (int x = 0; x < columns; x++) {

return totalMinWidth;
}
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
D.assert(_children.Count == rows * columns);
float totalMaxWidth = 0.0f;
for (int x = 0; x < columns; x++) {

return totalMaxWidth;
}
protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
D.assert(_children.Count == rows * columns);
List<float> widths = _computeColumnWidths(BoxConstraints.tightForFinite(width: width));
float rowTop = 0.0f;

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


return true;
}
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
D.assert(debugThrowIfNotCheckingIntrinsics());
return 0.0f;
}

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


return width;
}
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
switch (direction) {
case Axis.horizontal:
float width = 0.0f;

throw new Exception("Unknown axis: " + direction);
}
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
switch (direction) {
case Axis.horizontal:
float width = 0.0f;

throw new Exception("Unknown axis: " + direction);
}
protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
switch (direction) {
case Axis.horizontal:
return _computeIntrinsicHeightForWidth(width);

59
com.unity.uiwidgets/Runtime/widgets/layout_builder.cs


return base.widget as ConstrainedLayoutBuilder<ConstraintType>;
}
}
public new RenderObjectConstrainedLayoutBuilder<ConstraintType, RenderObject> renderObject {
get { return base.renderObject as RenderObjectConstrainedLayoutBuilder<ConstraintType, RenderObject>;}
public new RenderConstrainedLayoutBuilderMixinRenderObject<ConstraintType, RenderObject> renderObject {
get { return base.renderObject as RenderConstrainedLayoutBuilderMixinRenderObject<ConstraintType, RenderObject>;}
}
Element _child;

}
protected override void removeChildRenderObject(RenderObject child) {
RenderConstrainedLayoutBuilder<ConstraintType, RenderObject> renderObject = this.renderObject;
RenderConstrainedLayoutBuilderMixinRenderObject<ConstraintType, RenderObject> renderObject = this.renderObject;
D.assert(renderObject.child == child);
renderObject.child = null;
D.assert(renderObject == this.renderObject);

public interface RenderConstrainedLayoutBuilder<ConstraintType,ChildType> : RenderObjectWithChildMixin<ChildType>
public interface RenderConstrainedLayoutBuilder<ConstraintType,ChildType>
where ConstraintType : Constraints
where ChildType : RenderObject
{

void updateCallback(LayoutCallback<ConstraintType> value);
void layoutAndBuildChild();
// public ChildType child { get; set; }
public class RenderObjectConstrainedLayoutBuilder<ConstraintType, ChildType> :
RenderObjectWithChildMixinRenderObject<ChildType>, RenderConstrainedLayoutBuilder<ConstraintType, ChildType>
where ConstraintType : Constraints
where ChildType : RenderObject {
/// <summary>
/// something skeptical
/// </summary>
protected override void debugAssertDoesMeetConstraints() {
//throw new System.NotImplementedException();
}
protected override void performResize() {
//throw new System.NotImplementedException();
}
protected override void performLayout() {
//base.performLayout();
}
public override Rect paintBounds { get; }
public override Rect semanticBounds { get; }
public LayoutCallback<ConstraintType> _callback { get; set; }
public void updateCallback(LayoutCallback<ConstraintType> value) {
if (value == _callback)
return;
_callback = value;
markNeedsLayout();
}
public void layoutAndBuildChild() {
D.assert(_callback != null);
invokeLayoutCallback(_callback);
}
}
public class LayoutBuilder : ConstrainedLayoutBuilder<BoxConstraints> {
public LayoutBuilder(
Key key = null,

}
}
public class _RenderLayoutBuilder : RenderObjectWithChildMixinRenderBox<RenderBox> {
public class _RenderLayoutBuilder : RenderConstrainedLayoutBuilderMixinRenderBox<BoxConstraints, RenderBox> {
LayoutCallback<BoxConstraints> callback = null) {
LayoutCallback<BoxConstraints> callback = null) {
_callback = callback;
}

return true;
}
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
D.assert(_debugThrowIfNotCheckingIntrinsics());
return 0.0f;
}

6
com.unity.uiwidgets/Runtime/widgets/overlay.cs


get { return childCount - skipCount; }
}
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
return RenderStack.getIntrinsicDimension(_firstOnstageChild,
(RenderBox child) => child.getMinIntrinsicHeight(width));
}

6
com.unity.uiwidgets/Runtime/widgets/single_child_scroll_view.cs


}
protected override float computeMinIntrinsicWidth(float height) {
protected internal override float computeMinIntrinsicWidth(float height) {
if (child != null) {
return child.getMinIntrinsicWidth(height);
}

protected override float computeMaxIntrinsicWidth(float height) {
protected internal override float computeMaxIntrinsicWidth(float height) {
if (child != null) {
return child.getMaxIntrinsicWidth(height);
}

protected override float computeMinIntrinsicHeight(float width) {
protected internal override float computeMinIntrinsicHeight(float width) {
if (child != null) {
return child.getMinIntrinsicHeight(width);
}

7
com.unity.uiwidgets/Runtime/widgets/sliver_layout_builder.cs


return new _RenderSliverLayoutBuilder();
}
}
public class _RenderSliverLayoutBuilder : RenderObjectWithChildMixinRenderSliver<RenderSliver>, RenderConstrainedLayoutBuilder<SliverConstraints, RenderSliver> {
public class _RenderSliverLayoutBuilder : RenderConstrainedLayoutBuilderMixinRenderSliver<SliverConstraints, RenderSliver> {
public override float? childMainAxisPosition(RenderObject child) {
D.assert(child != null);
D.assert(child == this.child);

adoptChild(_child);
}
}
}
RenderObject RenderObjectWithChildMixin.child {
get { return child; }
set { child = (RenderSliver)value; }
}
public LayoutCallback<SliverConstraints> _callback { get; set; }

18
com.unity.uiwidgets/Scripts/cmds/codegen.js


var nunjucks = require('nunjucks');
var chokidar = require('chokidar');
exports.command = 'codegen [dir]';
exports.command = 'codegen [dir] [file]';
exports.desc = "generate mixin code";
exports.builder = function (yargs) {
return yargs.positional('dir', {

}).positional('file', {
describe: 'the target file if specified',
type: 'string',
default: ''
}).option('watch', {
alias: 'w',
describe: 'Watch for file changes',

exports.handler = function (argv) {
var cwd = path.resolve(__dirname, '../..', argv.dir);
var file = ''
if (argv.file != '') {
file = argv.file;
}
var data = {};
var env = nunjucks.configure(cwd, {
trimBlocks: true,

if (err) {
return console.error(chalk.red(err));
}
renderAll(env, cwd, files, data);
if (files.indexOf(file) >=0) {
render(env, cwd, file, data);
}
else {
renderAll(env, cwd, files, data);
}
});
if (argv.watch) {

正在加载...
取消
保存