浏览代码

Merge branch 'shiyun/skia' of https://github.com/Unity-Technologies/com.unity.uiwidgets into shiyun/skia

/siyaoH-1.17-PlatformMessage
Shiyun Wen 4 年前
当前提交
dbec1d50
共有 2 个文件被更改,包括 31 次插入1 次删除
  1. 29
      com.unity.uiwidgets/Runtime/rendering/stack.cs
  2. 3
      com.unity.uiwidgets/Runtime/widgets/basic.cs

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


public RenderStack(
StackFit? fit,
Overflow? overflow,
TextDirection textDirection,
this.textDirection = textDirection;
_alignment = alignment ?? Alignment.topLeft;
_fit = fit ?? StackFit.loose;
_overflow = overflow ?? Overflow.clip;

child.parentData = new StackParentData();
}
}
Alignment _resolvedAlignment;
void _markNeedResolution() {
_resolvedAlignment = null;
markNeedsLayout();
}
public TextDirection textDirection {
get {
return _textDirection;
}
set {
if (_textDirection == value)
return;
_textDirection = value;
_markNeedResolution();
}
}
TextDirection _textDirection;
Alignment _alignment;
public Alignment alignment {

public RenderIndexedStack(
List<RenderBox> children = null,
Alignment alignment = null,
TextDirection textDirection = default,
) : base(fit: null, overflow: null, children: children, alignment: alignment ?? Alignment.topLeft) {
) : base(fit: null, overflow: null, textDirection: textDirection, children: children, alignment: alignment ?? Alignment.topLeft) {
_index = index;
}

3
com.unity.uiwidgets/Runtime/widgets/basic.cs


public override RenderObject createRenderObject(BuildContext context) {
return new RenderStack(
alignment: alignment,
textDirection: Directionality.of(context),
fit: fit,
overflow: overflow
);

var renderObject = (RenderStack) renderObjectRaw;
renderObject.alignment = alignment;
renderObject.textDirection = Directionality.of(context);
renderObject.fit = fit;
renderObject.overflow = overflow;
}

properties.add(new DiagnosticsProperty<Alignment>("alignment", alignment));
properties.add(new EnumProperty<TextDirection>("textDirection", textDirection, defaultValue: null));
properties.add(new EnumProperty<StackFit>("fit", fit));
properties.add(new EnumProperty<Overflow>("overflow", overflow));
}

正在加载...
取消
保存