浏览代码

fix list_wheel_scroll_view.cs

/siyaoH-1.17-PlatformMessage
guanghuispark 4 年前
当前提交
e2269fa4
共有 3 个文件被更改,包括 74 次插入3 次删除
  1. 42
      com.unity.uiwidgets/Runtime/rendering/list_wheel_viewport.cs
  2. 2
      com.unity.uiwidgets/Runtime/widgets/fade_in_image.cs
  3. 33
      com.unity.uiwidgets/Runtime/widgets/list_wheel_scroll_view.cs

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


float offAxisFraction = 0.0f,
bool useMagnifier = false,
float magnification = 1.0f,
float overAndUnderCenterOpacity = 1.0f,
float squeeze = 1.0f,
bool clipToSize = true,
bool renderChildrenOutsideViewport = false,
List<RenderBox> children = null

D.assert(perspective > 0);
D.assert(perspective <= 0.01f, () => perspectiveTooHighMessage);
D.assert(magnification > 0);
D.assert(overAndUnderCenterOpacity != null);
D.assert(overAndUnderCenterOpacity >= 0 && overAndUnderCenterOpacity <= 1);
D.assert(squeeze != null);
D.assert(squeeze > 0);
D.assert(
!renderChildrenOutsideViewport || !clipToSize,
() => clipToSizeAndRenderChildrenOutsideViewportConflict

_offAxisFraction = offAxisFraction;
_useMagnifier = useMagnifier;
_magnification = magnification;
_overAndUnderCenterOpacity = overAndUnderCenterOpacity;
_squeeze = squeeze;
_clipToSize = clipToSize;
_renderChildrenOutsideViewport = renderChildrenOutsideViewport;
addAll(children);

float _magnification = 1.0f;
public float overAndUnderCenterOpacity {
get {
return _overAndUnderCenterOpacity;
}
set {
D.assert(value != null);
D.assert(value >= 0 && value <= 1);
if (value == _overAndUnderCenterOpacity)
return;
_overAndUnderCenterOpacity = value;
markNeedsPaint();
}
}
float _overAndUnderCenterOpacity = 1.0f;
public float itemExtent {
get { return _itemExtent; }
set {

}
float _itemExtent;
public float squeeze {
get {
return _squeeze;
}
set {
D.assert(value != null);
D.assert(value > 0);
if (value == _squeeze)
return;
_squeeze = value;
markNeedsLayout();
}
}
float _squeeze;
public bool clipToSize {
get { return _clipToSize; }

2
com.unity.uiwidgets/Runtime/widgets/fade_in_image.cs


return new Stack(
fit: StackFit.passthrough,
alignment: AlignmentDirectional.center,
alignment: Alignment.center,//AlignmentDirectional.center,[!!!]
textDirection: TextDirection.ltr,
children: new List<Widget>() {
target,

33
com.unity.uiwidgets/Runtime/widgets/list_wheel_scroll_view.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.foundation;

return null;
}
List<Future> futures = new List<Future>();
foreach (_FixedExtentScrollPosition position in positions) {
foreach (_FixedExtentScrollPosition position in positions.Cast<_FixedExtentScrollPosition>()) {
futures.Add(position.animateTo(
itemIndex * position.itemExtent,
duration: duration,

float offAxisFraction = 0.0f,
bool useMagnifier = false,
float magnification = 1.0f,
float overAndUnderCenterOpacity = 1.0f,
float squeeze = 1.0f,
ValueChanged<int> onSelectedItemChanged = null,
bool clipToSize = true,
bool renderChildrenOutsideViewport = false,

D.assert(perspective > 0);
D.assert(perspective <= 0.01f, () => RenderListWheelViewport.perspectiveTooHighMessage);
D.assert(magnification > 0);
D.assert(overAndUnderCenterOpacity != null);
D.assert(overAndUnderCenterOpacity >= 0 && overAndUnderCenterOpacity <= 1);
D.assert(squeeze != null);
D.assert(squeeze > 0);
D.assert(
!renderChildrenOutsideViewport || !clipToSize,
() => RenderListWheelViewport.clipToSizeAndRenderChildrenOutsideViewportConflict

this.overAndUnderCenterOpacity = overAndUnderCenterOpacity;
this.squeeze = squeeze;
this.controller = controller;
this.physics = physics;
this.diameterRatio = diameterRatio;

public static ListWheelScrollView useDelegate(
float itemExtent,
float overAndUnderCenterOpacity = 1.0f,
float squeeze = 1.0f,
List<Widget> children = null,
ListWheelChildDelegate childDelegate = null,
Key key = null,

public readonly bool useMagnifier;
public readonly float magnification;
public readonly float itemExtent;
public readonly float overAndUnderCenterOpacity;
public readonly float squeeze;
public readonly ValueChanged<int> onSelectedItemChanged;
public readonly bool clipToSize;
public readonly bool renderChildrenOutsideViewport;

offAxisFraction: widget.offAxisFraction,
useMagnifier: widget.useMagnifier,
magnification: widget.magnification,
overAndUnderCenterOpacity: widget.overAndUnderCenterOpacity,
squeeze: widget.squeeze,
clipToSize: widget.clipToSize,
renderChildrenOutsideViewport: widget.renderChildrenOutsideViewport,
offset: _offset,

internal override void forgetChild(Element child) {
_childElements.Remove((int) (child.slot));
base.forgetChild(child);
}
}

bool useMagnifier = false,
float magnification = 1.0f,
bool clipToSize = true,
bool renderChildrenOutsideViewport = false
bool renderChildrenOutsideViewport = false,
float overAndUnderCenterOpacity = 1.0f,
float squeeze = 1.0f
) : base(key: key) {
D.assert(childDelegate != null);
D.assert(offset != null);

D.assert(overAndUnderCenterOpacity != null);
D.assert(overAndUnderCenterOpacity >= 0 && overAndUnderCenterOpacity <= 1);
D.assert(itemExtent > 0);
D.assert(
!renderChildrenOutsideViewport || !clipToSize,

this.magnification = magnification;
this.clipToSize = clipToSize;
this.renderChildrenOutsideViewport = renderChildrenOutsideViewport;
this.overAndUnderCenterOpacity = overAndUnderCenterOpacity;
this.squeeze = squeeze;
}
public readonly float diameterRatio;

public readonly float magnification;
public readonly float overAndUnderCenterOpacity;
public readonly float squeeze;
public readonly bool clipToSize;
public readonly bool renderChildrenOutsideViewport;
public readonly ViewportOffset offset;

offAxisFraction: offAxisFraction,
useMagnifier: useMagnifier,
magnification: magnification,
overAndUnderCenterOpacity: overAndUnderCenterOpacity,
squeeze: squeeze,
clipToSize: clipToSize,
renderChildrenOutsideViewport: renderChildrenOutsideViewport
);

viewport.offAxisFraction = offAxisFraction;
viewport.useMagnifier = useMagnifier;
viewport.magnification = magnification;
viewport.overAndUnderCenterOpacity = overAndUnderCenterOpacity;
viewport.squeeze = squeeze;
viewport.clipToSize = clipToSize;
viewport.renderChildrenOutsideViewport = renderChildrenOutsideViewport;
}
正在加载...
取消
保存