浏览代码

update AlignmentGeometry

/siyaoH-1.17-PlatformMessage
siyao 4 年前
当前提交
5be8db5c
共有 7 个文件被更改,包括 37 次插入31 次删除
  1. 4
      com.unity.uiwidgets/Runtime/cupertino/date_picker.cs
  2. 4
      com.unity.uiwidgets/Runtime/material/icon_button.cs
  3. 2
      com.unity.uiwidgets/Runtime/material/ink_decoration.cs
  4. 6
      com.unity.uiwidgets/Runtime/painting/decoration_image.cs
  5. 38
      com.unity.uiwidgets/Runtime/painting/gradient.cs
  6. 8
      com.unity.uiwidgets/Runtime/widgets/animated_cross_fade.cs
  7. 6
      com.unity.uiwidgets/Runtime/widgets/transitions.cs

4
com.unity.uiwidgets/Runtime/cupertino/date_picker.cs


TimeSpan? initialTimerDuration = null,
int minuteInterval = 1,
int secondInterval = 1,
Alignment alignment = null,
AlignmentGeometry alignment = null,
Color backgroundColor = null,
ValueChanged<TimeSpan> onTimerDurationChanged = null
):base(key : key) {

public readonly int minuteInterval;
public readonly int secondInterval;
public readonly ValueChanged<TimeSpan> onTimerDurationChanged;
public readonly Alignment alignment;
public readonly AlignmentGeometry alignment;
public readonly Color backgroundColor;
public override State createState() {

4
com.unity.uiwidgets/Runtime/material/icon_button.cs


float iconSize = 24.0f,
VisualDensity visualDensity = null,
EdgeInsetsGeometry padding = null,
Alignment alignment = null,
AlignmentGeometry alignment = null,
Widget icon = null,
Color color = null,
Color focusColor = null,

public readonly EdgeInsetsGeometry padding;
public readonly Alignment alignment;
public readonly AlignmentGeometry alignment;
public readonly Widget icon;

2
com.unity.uiwidgets/Runtime/material/ink_decoration.cs


ImageErrorListener onImageError = null,
ColorFilter colorFilter = null,
BoxFit? fit = null,
Alignment alignment = null,
AlignmentGeometry alignment = null,
Rect centerSlice = null,
ImageRepeat repeat = ImageRepeat.noRepeat,
float? width = null,

6
com.unity.uiwidgets/Runtime/painting/decoration_image.cs


ImageErrorListener onError = null,
ColorFilter colorFilter = null,
BoxFit? fit = null,
Alignment alignment = null,
AlignmentGeometry alignment = null,
Rect centerSlice = null,
ImageRepeat repeat = ImageRepeat.noRepeat,
bool matchTextDirection = false

public readonly ImageErrorListener onError;
public readonly ColorFilter colorFilter;
public readonly BoxFit? fit;
public readonly Alignment alignment;
public readonly AlignmentGeometry alignment;
public readonly Rect centerSlice;
public readonly ImageRepeat repeat;
public readonly bool matchTextDirection;

scale: _image.scale,
colorFilter: _details.colorFilter,
fit: _details.fit,
alignment: _details.alignment,
alignment: _details.alignment.resolve(configuration.textDirection),
centerSlice: _details.centerSlice,
repeat: _details.repeat,
flipHorizontally: flipHorizontally,

38
com.unity.uiwidgets/Runtime/painting/gradient.cs


public class LinearGradient : Gradient, IEquatable<LinearGradient> {
public LinearGradient(
Alignment begin = null,
Alignment end = null,
AlignmentGeometry begin = null,
AlignmentGeometry end = null,
List<Color> colors = null,
List<float> stops = null,
TileMode tileMode = TileMode.clamp,

this.tileMode = tileMode;
}
public readonly Alignment begin;
public readonly AlignmentGeometry begin;
public readonly Alignment end;
public readonly AlignmentGeometry end;
begin.withinRect(rect),
end.withinRect(rect),
begin.resolve(textDirection).withinRect(rect),
end.resolve(textDirection).withinRect(rect),
colors, _impliedStops(),
tileMode, _resolveTransform(rect, textDirection)
);

b._impliedStops(),
t);
return new LinearGradient(
begin: Alignment.lerp(a.begin, b.begin, t),
end: Alignment.lerp(a.end, b.end, t),
begin: AlignmentGeometry.lerp(a.begin, b.begin, t),
end: AlignmentGeometry.lerp(a.end, b.end, t),
colors: interpolated.colors,
stops: interpolated.stops,
tileMode: t < 0.5 ? a.tileMode : b.tileMode

public class RadialGradient : Gradient, IEquatable<RadialGradient> {
public RadialGradient(
Alignment center = null,
AlignmentGeometry center = null,
AlignmentGeometry focal = null,
float focalRadius = 0.0f,
this.focal = focal;
this.focalRadius = focalRadius;
public readonly Alignment center;
public readonly AlignmentGeometry center;
public readonly float radius;

public override Shader createShader(Rect rect, TextDirection? textDirection = null) {
return ui.Gradient.radial(
center.withinRect(rect),
center.resolve(textDirection).withinRect(rect),
radius * rect.shortestSide,
colors, _impliedStops(),
tileMode,

b._impliedStops(),
t);
return new RadialGradient(
center: Alignment.lerp(a.center, b.center, t),
center: AlignmentGeometry.lerp(a.center, b.center, t),
tileMode: t < 0.5 ? a.tileMode : b.tileMode
tileMode: t < 0.5 ? a.tileMode : b.tileMode,
focal: AlignmentGeometry.lerp(a.focal, b.focal, t),
focalRadius: Mathf.Max(0.0f, Mathf.Lerp(a.focalRadius, b.focalRadius, t))
);
}

public class SweepGradient : Gradient, IEquatable<SweepGradient> {
public SweepGradient(
Alignment center = null,
AlignmentGeometry center = null,
float startAngle = 0.0f,
float endAngle = Mathf.PI * 2,
List<Color> colors = null,

this.tileMode = tileMode;
}
public readonly Alignment center;
public readonly AlignmentGeometry center;
public readonly float startAngle;

public override Shader createShader(Rect rect, TextDirection? textDirection = null) {
return ui.Gradient.sweep(
center.withinRect(rect),
center.resolve(textDirection).withinRect(rect),
colors, _impliedStops(),
tileMode,
startAngle, endAngle, _resolveTransform(rect, textDirection)

8
com.unity.uiwidgets/Runtime/widgets/animated_cross_fade.cs


Curve firstCurve = null,
Curve secondCurve = null,
Curve sizeCurve = null,
Alignment alignment = null,
AlignmentGeometry alignment = null,
CrossFadeState? crossFadeState = null,
TimeSpan? duration = null,
TimeSpan? reverseDuration = null,

public readonly Curve sizeCurve;
public readonly Alignment alignment;
public readonly AlignmentGeometry alignment;
public readonly AnimatedCrossFadeBuilder layoutBuilder;

public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new EnumProperty<CrossFadeState>("crossFadeState", crossFadeState));
properties.add(new DiagnosticsProperty<Alignment>("alignment", alignment,
properties.add(new DiagnosticsProperty<AlignmentGeometry>("alignment", alignment,
defaultValue: Alignment.topCenter));
properties.add(new IntProperty("duration", duration?.Milliseconds, unit: "ms"));
properties.add(new IntProperty("reverseDuration", reverseDuration?.Milliseconds, unit: "ms", defaultValue: null));

description.add(new EnumProperty<CrossFadeState>("crossFadeState", widget.crossFadeState));
description.add(
new DiagnosticsProperty<AnimationController>("controller", _controller, showName: false));
description.add(new DiagnosticsProperty<Alignment>("alignment", widget.alignment,
description.add(new DiagnosticsProperty<AlignmentGeometry>("alignment", widget.alignment,
defaultValue: Alignment.topCenter));
}
}

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


public class AlignTransition : AnimatedWidget {
public AlignTransition(
Animation<Alignment> alignment,
Animation<AlignmentGeometry> alignment,
Widget child,
Key key = null,
float? widthFactor = null,

this.heightFactor = heightFactor;
}
Animation<Alignment> alignment {
get { return (Animation<Alignment>) listenable; }
Animation<AlignmentGeometry> alignment {
get { return (Animation<AlignmentGeometry>) listenable; }
}
public readonly float? widthFactor;

正在加载...
取消
保存