浏览代码

[1.5.4] Upgrade rendering objects.

/main
Yuncong Zhang 5 年前
当前提交
27c41cc7
共有 10 个文件被更改,包括 373 次插入149 次删除
  1. 2
      Runtime/rendering/editable.cs
  2. 2
      Runtime/rendering/error.cs
  3. 5
      Runtime/rendering/flex.cs
  4. 164
      Runtime/rendering/layer.cs
  5. 9
      Runtime/rendering/object.cs
  6. 87
      Runtime/rendering/proxy_box.cs
  7. 225
      Runtime/ui/painting/path.cs
  8. 12
      Runtime/ui/text.cs
  9. 5
      Runtime/rendering/debug.cs
  10. 11
      Runtime/rendering/debug.cs.meta

2
Runtime/rendering/editable.cs


D.assert(this._textLayoutLastWidth == this.constraints.maxWidth);
var paint = new Paint() {color = this._floatingCursorOn ? this.backgroundCursorColor : this._cursorColor};
var caretOffset = this._textPainter.getOffsetForCaret(textPosition, this._caretPrototype) + effectiveOffset;
Rect caretRect = this._caretPrototype.shift(caretOffset + effectiveOffset);
Rect caretRect = this._caretPrototype.shift(caretOffset);
if (this._cursorOffset != null) {
caretRect = caretRect.shift(this._cursorOffset);
}

2
Runtime/rendering/error.cs


);
static ParagraphStyle paragraphStyle = new ParagraphStyle(
lineHeight: 1.0f
height: 1.0f
);
}
}

5
Runtime/rendering/flex.cs


if (totalFlex > 0 || this.crossAxisAlignment == CrossAxisAlignment.baseline) {
float spacePerFlex = canFlex && totalFlex > 0 ? (freeSpace / totalFlex) : float.NaN;
child = this.firstChild;
float maxSizeAboveBaseline = 0;
float maxSizeBelowBaseline = 0;
while (child != null) {
int flex = this._getFlex(child);
if (flex > 0) {

float? distance = child.getDistanceToBaseline(this.textBaseline, onlyReal: true);
if (distance != null) {
maxBaselineDistance = Mathf.Max(maxBaselineDistance, distance.Value);
maxSizeAboveBaseline = Mathf.Max(distance.Value, maxSizeAboveBaseline);
maxSizeBelowBaseline = Mathf.Max(child.size.height - distance.Value, maxSizeBelowBaseline);
crossSize = maxSizeAboveBaseline + maxSizeBelowBaseline;
}
}

164
Runtime/rendering/layer.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.external.simplejson;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;

public Layer lastChild {
get { return this._lastChild; }
}
internal override S find<S>(Offset regionOffset) {
Layer current = this.lastChild;
while (current != null) {

return child == equals;
}
PictureLayer _highlightConflictingLayer(PhysicalModelLayer child) {
PictureRecorder recorder = new PictureRecorder();
var canvas = new RecorderCanvas(recorder);
canvas.drawPath(child.clipPath, new Paint() {
color = new Color(0xFFAA0000),
style = PaintingStyle.stroke,
strokeWidth = child.elevation + 10.0f,
});
PictureLayer pictureLayer = new PictureLayer(child.clipPath.getBounds());
pictureLayer.picture = recorder.endRecording();
pictureLayer.debugCreator = child;
child.append(pictureLayer);
return pictureLayer;
}
List<PictureLayer> _processConflictingPhysicalLayers(PhysicalModelLayer predecessor, PhysicalModelLayer child) {
UIWidgetsError.reportError(new UIWidgetsErrorDetails(
exception: new UIWidgetsError("Painting order is out of order with respect to elevation.\n" +
"See https://api.flutter.dev/flutter/rendering/debugCheckElevations.html " +
"for more details."),
context: "during compositing",
informationCollector: (StringBuilder builder) => {
builder.AppendLine("Attempted to composite layer");
builder.AppendLine(child.ToString());
builder.AppendLine("after layer");
builder.AppendLine(predecessor.ToString());
builder.AppendLine("which occupies the same area at a higher elevation.");
}
));
return new List<PictureLayer> {
this._highlightConflictingLayer(predecessor),
this._highlightConflictingLayer(child)
};
}
protected List<PictureLayer> _debugCheckElevations() {
List<PhysicalModelLayer> physicalModelLayers =
this.depthFirstIterateChildren().OfType<PhysicalModelLayer>().ToList();
List<PictureLayer> addedLayers = new List<PictureLayer>();
for (int i = 0; i < physicalModelLayers.Count; i++) {
PhysicalModelLayer physicalModelLayer = physicalModelLayers[i];
D.assert(physicalModelLayer.lastChild?.debugCreator != physicalModelLayer,
() => "debugCheckElevations has either already visited this layer or failed to remove the" +
" added picture from it.");
float accumulatedElevation = physicalModelLayer.elevation;
Layer ancestor = physicalModelLayer.parent;
while (ancestor != null) {
if (ancestor is PhysicalModelLayer modelLayer) {
accumulatedElevation += modelLayer.elevation;
}
ancestor = ancestor.parent;
}
for (int j = 0; j <= i; j++) {
PhysicalModelLayer predecessor = physicalModelLayers[j];
float predecessorAccumulatedElevation = predecessor.elevation;
ancestor = predecessor.parent;
while (ancestor != null) {
if (ancestor == predecessor) {
continue;
}
if (ancestor is PhysicalModelLayer modelLayer) {
predecessorAccumulatedElevation += modelLayer.elevation;
}
ancestor = ancestor.parent;
}
if (predecessorAccumulatedElevation <= accumulatedElevation) {
continue;
}
Path intersection = Path.combine(
PathOperation.intersect,
predecessor._debugTransformedClipPath,
physicalModelLayer._debugTransformedClipPath);
if (intersection != null && intersection.computeMetrics().Any((metric) => metric.length > 0)) {
addedLayers.AddRange(this._processConflictingPhysicalLayers(predecessor, physicalModelLayer));
}
}
}
return addedLayers;
}
internal override void updateSubtreeNeedsAddToScene() {
base.updateSubtreeNeedsAddToScene();
Layer child = this.firstChild;

D.assert(transform != null);
}
public List<Layer> depthFirstIterateChildren() {
if (this.firstChild == null) {
return new List<Layer>();
}
List<Layer> children = new List<Layer>();
Layer child = this.firstChild;
while (child != null) {
children.Add(child);
if (child is ContainerLayer containerLayer) {
children.AddRange(containerLayer.depthFirstIterateChildren());
}
child = child.nextSibling;
}
return children;
}
public override List<DiagnosticsNode> debugDescribeChildren() {
var children = new List<DiagnosticsNode>();
if (this.firstChild == null) {

}
public Scene buildScene(SceneBuilder builder) {
List<PictureLayer> temporaryLayers = null;
D.assert(() => {
if (RenderingDebugUtils.debugCheckElevationsEnabled) {
temporaryLayers = this._debugCheckElevations();
}
return true;
});
return builder.build();
Scene scene = builder.build();
D.assert(() => {
if (temporaryLayers != null) {
foreach (PictureLayer temporaryLayer in temporaryLayers) {
temporaryLayer.remove();
}
}
return true;
});
return scene;
}
internal override flow.Layer addToScene(SceneBuilder builder, Offset layerOffset = null) {

if (this._invertedTransform == null) {
return null;
}
Offset transform = this._invertedTransform.mapXY(regionOffset.dx, regionOffset.dy);
return base.find<S>(transform);
}

public override void applyTransform(Layer child, Matrix3 transform) {
D.assert(child != null);
D.assert(transform != null);
transform.preConcat(this._lastEffectiveTransform);
D.assert(this._lastEffectiveTransform != null || this.transform != null);
if (this._lastEffectiveTransform == null) {
transform.preConcat(this.transform);
}
else {
transform.preConcat(this._lastEffectiveTransform);
}
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {

properties.add(new DiagnosticsProperty<Offset>("offset", this.offset));
}
}
public class BackdropFilterLayer : ContainerLayer {
public BackdropFilterLayer(ImageFilter filter = null) {
D.assert(filter != null);

protected override bool alwaysNeedsAddToScene {
get { return true; }
}
internal override flow.Layer addToScene(SceneBuilder builder, Offset layerOffset = null) {
layerOffset = layerOffset ?? Offset.zero;

}
}
}
internal Path _debugTransformedClipPath {
get {
ContainerLayer ancestor = this.parent;
Matrix3 matrix = Matrix3.I();
while (ancestor != null && ancestor.parent != null) {
ancestor.applyTransform(this, matrix);
ancestor = ancestor.parent;
}
return this.clipPath.transform(matrix);
}
}
Clip _clipBehavior;

9
Runtime/rendering/object.cs


using Unity.UIWidgets.ui;
using UnityEngine;
using Canvas = Unity.UIWidgets.ui.Canvas;
using Color = Unity.UIWidgets.ui.Color;
using Rect = Unity.UIWidgets.ui.Rect;
namespace Unity.UIWidgets.rendering {

Paint paint = new Paint {
style = PaintingStyle.stroke,
strokeWidth = 1.0f,
color = new ui.Color(0xFFFF9800),
color = new Color(0xFFFF9800),
};
this.canvas.drawRect(this.estimatedBounds, paint);
}

Matrix3 effectiveTransform;
if (offset == null || offset == Offset.zero) {
effectiveTransform = transform;
} else {
}
else {
effectiveTransform = Matrix3.makeTrans(offset.dx, offset.dy);
effectiveTransform.preConcat(transform);
effectiveTransform.preTranslate(-offset.dx, -offset.dy);

var inverse = Matrix3.I();
var invertible = effectiveTransform.invert(inverse);
// it could just be "scale == 0", ignore the assertion.
// D.assert(invertible);

}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new DiagnosticsProperty<object>(
"creator", this.debugCreator, defaultValue: Diagnostics.kNullDefaultValue,
level: DiagnosticLevel.debug));

87
Runtime/rendering/proxy_box.cs


Color _color;
protected static Paint _transparentPaint {
get { return new Paint {color = new Color(0x00000000)}; }
}
get { return this._elevation != 0.0; }
get { return true; }
}
public override void debugFillProperties(DiagnosticPropertiesBuilder description) {

Path offsetRRectAsPath = new Path();
offsetRRectAsPath.addRRect(offsetRRect);
if (this.needsCompositing) {
PhysicalModelLayer physicalModel = new PhysicalModelLayer(
clipPath: offsetRRectAsPath,
clipBehavior: this.clipBehavior,
elevation: this.elevation,
color: this.color,
shadowColor: this.shadowColor);
context.pushLayer(physicalModel, base.paint, offset, childPaintBounds: offsetBounds);
}
else {
Canvas canvas = context.canvas;
if (this.elevation != 0.0) {
canvas.drawRect(
offsetBounds.inflate(20.0f),
_transparentPaint
);
canvas.drawShadow(
offsetRRectAsPath,
this.shadowColor,
this.elevation,
this.color.alpha != 0xFF
);
}
Paint paint = new Paint {color = this.color};
canvas.drawRRect(offsetRRect, paint);
context.clipRRectAndPaint(offsetRRect, this.clipBehavior, offsetBounds,
() => base.paint(context, offset));
D.assert(context.canvas == canvas, () => "canvas changed even though needsCompositing was false");
}
PhysicalModelLayer physicalModel = new PhysicalModelLayer(
clipPath: offsetRRectAsPath,
clipBehavior: this.clipBehavior,
elevation: this.elevation,
color: this.color,
shadowColor: this.shadowColor);
D.assert(() => {
physicalModel.debugCreator = this.debugCreator;
return true;
});
context.pushLayer(physicalModel, base.paint, offset, childPaintBounds: offsetBounds);
}
}

Path offsetPath = new Path();
offsetPath.addPath(this._clip, offset);
if (this.needsCompositing) {
PhysicalModelLayer physicalModel = new PhysicalModelLayer(
clipPath: offsetPath,
clipBehavior: this.clipBehavior,
elevation: this.elevation,
color: this.color,
shadowColor: this.shadowColor);
context.pushLayer(physicalModel, base.paint, offset, childPaintBounds: offsetBounds);
}
else {
Canvas canvas = context.canvas;
if (this.elevation != 0.0) {
canvas.drawRect(
offsetBounds.inflate(20.0f),
_transparentPaint
);
canvas.drawShadow(
offsetPath,
this.shadowColor,
this.elevation,
this.color.alpha != 0xFF
);
}
Paint paint = new Paint {color = this.color, style = PaintingStyle.fill};
canvas.drawPath(offsetPath, paint);
context.clipPathAndPaint(offsetPath, this.clipBehavior,
offsetBounds, () => base.paint(context, offset));
D.assert(context.canvas == canvas, () => "canvas changed even though needsCompositing was false");
}
PhysicalModelLayer physicalModel = new PhysicalModelLayer(
clipPath: offsetPath,
clipBehavior: this.clipBehavior,
elevation: this.elevation,
color: this.color,
shadowColor: this.shadowColor);
context.pushLayer(physicalModel, base.paint, offset, childPaintBounds: offsetBounds);
}
}

public delegate void PointerUpEventListener(PointerUpEvent evt);
public delegate void PointerCancelEventListener(PointerCancelEvent evt);
// public delegate void PointerSignalEventListener(PointerSignalEvent evt);
public delegate void PointerScrollEventListener(PointerScrollEvent evt);

225
Runtime/ui/painting/path.cs


using System;
using System.Collections;
using Vector2 = UnityEngine.Vector2;
using Vector3 = UnityEngine.Vector3;
namespace Unity.UIWidgets.ui {
public enum PathOperation {

xor,
reverseDifference,
}
public class Path {
const float _KAPPA90 = 0.5522847493f;

float _minX, _minY;
float _maxX, _maxY;
PathCache _cache;
static uint pathGlobalKey = 0;

public uint pathKey {
get {
return this._pathKey;
}
get { return this._pathKey; }
}
public Path(int capacity = 128) {

public List<float> commands => this._commands;
public List<float> commands {
get { return this._commands; }
}
public override string ToString() {
var sb = new StringBuilder("Path: count = " + this._commands.Count);

internal PathCache flatten(float scale) {
scale = Mathf.Round(scale * 2.0f) / 2.0f; // round to 0.5f
this._cache = new PathCache(scale);
var i = 0;

if (x < this._minX) {
this._minX = x;
}
if (y < this._minY) {
this._minY = y;
}

}
if (y > this._maxY) {
this._maxY = y;
}

public static Path combine(PathOperation operation, Path path1, Path path2) {
D.assert(path1 != null);
D.assert(path2 != null);
Path path = new Path();
throw new UIWidgetsError("Path._op() not implemented yet!");
Path path = null;
D.assert(() => {
Debug.LogWarning("Path._op() not implemented yet!");
return true;
});
return path;
// if (path._op(path1, path2, (int) operation)) {
// return path;
// }

public PathMetrics computeMetrics(bool forceClosed = false) {
return PathMetrics._(this, forceClosed);
}
void _appendMoveTo(float x, float y) {
this._commands.Add((float) PathCommand.moveTo);
this._commands.Add(x);

this._commandy = y;
this._pathKey = pathGlobalKey++;
this._cache = null;
}

this._commandx = x;
this._commandy = y;
this._pathKey = pathGlobalKey++;
this._cache = null;
}

this._expandBounds(x1, y1);
this._expandBounds(x2, y2);
this._expandBounds(x3, y3);
this._commands.Add((float) PathCommand.bezierTo);
this._commands.Add(x1);
this._commands.Add(y1);

this._commands.Add(y3);
this._pathKey = pathGlobalKey++;
this._cache = null;
}

this._commands.Add(winding);
this._pathKey = pathGlobalKey++;
this._cache = null;
}

var y0 = this._commandy;
this._appendMoveTo(x + x0, y + y0);
}

public void relativeLineTo(float x, float y) {
var x0 = this._commandx;
var y0 = this._commandy;
public void lineTo(float x, float y) {
this._appendLineTo(x, y);
}

}
this.cubicTo(x0 + c1x, y0 + c1y, x0 + c2x, y0 + c2y, x0 + x, y0 + y);
}

if (!(w > 0)) {
this.lineTo(x2, y2);
return;
}
}
}
}
if (w == 1) {
this.quadraticBezierTo(x1, y1, x2, y2);
return;

var quadX = new float[5];
var quadY = new float[5];
conic.chopIntoQuadsPOW2(quadX, quadY, 1);
this.quadraticBezierTo(quadX[1], quadY[1], quadX[2], quadY[2]);
this.quadraticBezierTo(quadX[3], quadY[3], quadX[4], quadY[4]);
}

var y0 = this._commandy;
this.conicTo(x0 + x1, y0 + y1, x0 + x2, y0 + y2, w);
}

var squareRy = ry * ry;
var squareX = transformedMidPoint.dx * transformedMidPoint.dx;
var squareY = transformedMidPoint.dy * transformedMidPoint.dy;
// Check if the radii are big enough to draw the arc, scale radii if not.
// http://www.w3.org/TR/SVG/implnote.html#ArcCorrectionOutOfRangeRadii
var radiiScale = squareX / squareRx + squareY / squareRy;

ry *= radiiScale;
}
var unitPts = new [] {
var unitPts = new[] {
if (!clockwise != largeArc) { // flipped from the original implementation
if (!clockwise != largeArc) {
// flipped from the original implementation
if (thetaArc < 0 && clockwise) { // arcSweep flipped from the original implementation
if (thetaArc < 0 && clockwise) {
// arcSweep flipped from the original implementation
} else if (thetaArc > 0 && !clockwise) { // arcSweep flipped from the original implementation
}
else if (thetaArc > 0 && !clockwise) {
// arcSweep flipped from the original implementation
// the arc may be slightly bigger than 1/4 circle, so allow up to 1/3rd
int segments = Mathf.CeilToInt(Mathf.Abs(thetaArc / (2 * Mathf.PI / 3)));
var thetaWidth = thetaArc / segments;

}
bool expectIntegers = ScalarUtils.ScalarNearlyZero(Mathf.PI/2 - Mathf.Abs(thetaWidth)) &&
bool expectIntegers = ScalarUtils.ScalarNearlyZero(Mathf.PI / 2 - Mathf.Abs(thetaWidth)) &&
ScalarUtils.ScalarIsInteger(rx) && ScalarUtils.ScalarIsInteger(ry) &&
ScalarUtils.ScalarIsInteger(x1) && ScalarUtils.ScalarIsInteger(y1);

unitPts[1] += centerPoint;
unitPts[0] = unitPts[1];
unitPts[0] = unitPts[0].translate(t * sinEndTheta, -t * cosEndTheta);
var mapped = new [] {
var mapped = new[] {
/*
Computing the arc width introduces rounding errors that cause arcs to start
outside their marks. A round rect may lose convexity as a result. If the input

a0 = Mathf.Atan2(dx0, -dy0);
a1 = Mathf.Atan2(-dx1, dy1);
dir = PathWinding.clockwise;
} else {
}
else {
cx = x1 + dx0 * d + -dy0 * radius;
cy = y1 + dy0 * d + dx0 * radius;
a0 = Mathf.Atan2(-dx0, dy0);

if (dir == PathWinding.clockwise) {
if (Mathf.Abs(da) >= Mathf.PI * 2) {
da = Mathf.PI * 2;
} else {
}
else {
} else {
}
else {
} else {
}
else {
// Split arc into max 90 degree segments.
int ndivs = Mathf.Max(1, Mathf.Min((int) (Mathf.Abs(da) / (Mathf.PI * 0.5f) + 0.5f), 5));
float hda = (da / ndivs) / 2.0f;

if (move == PathCommand.moveTo) {
this._appendMoveTo(x1, y1);
} else {
}
else {
} else {
}
else {
float c1x = px + ptanx;
float c1y = py + ptany;
float c2x = x - tanx;

this._appendBezierTo(c1x, c1y, c2x, c2y, x1, y1);
}
px = x;
py = y;
ptanx = tanx;

if (points.Count == 0) {
return;
}
this._appendMoveTo(points[0].dx, points[0].dy);
for (int i = 1; i < points.Count; i++) {

this.addPath(path);
return;
}
var transform = Matrix3.makeTrans(offset.dx, offset.dy);
this.addPath(path, transform);
}

if (transform != null) {
transform.mapXY(x, y, out x, out y);
}
this._appendMoveTo(x, y);
}
i += 3;

if (transform != null) {
transform.mapXY(x, y, out x, out y);
}
this._appendLineTo(x, y);
}
i += 3;

transform.mapXY(c2x, c2y, out c2x, out c2y);
transform.mapXY(x1, y1, out x1, out y1);
}
this._appendBezierTo(c1x, c1y, c2x, c2y, x1, y1);
}
i += 7;

return totalW != 0;
}
static int windingLine(float x0, float y0, float x1, float y1, float x, float y) {
if (y0 == y1) {
return 0;

}
}
public class PathMetrics : IEnumerable<PathMetric> {
public PathMetrics(IEnumerator<PathMetric> enumerator) {
this._enumerator = enumerator;
}
public static PathMetrics _(Path path, bool forceClosed) {
return new PathMetrics(PathMetricIterator._(new _PathMeasure())); // TODO: complete the implementation
}
public readonly IEnumerator<PathMetric> _enumerator;
public IEnumerator<PathMetric> GetEnumerator() {
return this._enumerator;
}
IEnumerator IEnumerable.GetEnumerator() {
return this.GetEnumerator();
}
}
public class PathMetric {
// TODO
public readonly float length;
}
public class PathMetricIterator : IEnumerator<PathMetric> {
PathMetricIterator(_PathMeasure measure) {
this._pathMeasure = measure;
}
internal static PathMetricIterator _(_PathMeasure _pathMeasure) {
D.assert(_pathMeasure != null);
return new PathMetricIterator(_pathMeasure);
}
PathMetric _pathMetric;
_PathMeasure _pathMeasure;
public void Reset() {
throw new NotImplementedException();
}
public PathMetric Current {
get { return this._pathMetric; }
}
object IEnumerator.Current {
get { return this._pathMetric; }
}
public bool MoveNext() {
// if (_pathMeasure._nextContour()) {
// _pathMetric = PathMetric._(_pathMeasure);
// return true;
// }
// _pathMetric = null;
return false;
}
public void Dispose() {
throw new NotImplementedException();
}
}
class _PathMeasure {
}
public enum PathWinding {
counterClockwise = 1, // which just means the order as the input is.
clockwise = 2, // which just means the reversed order.

var closerY = Mathf.Abs(midY - startY) < Mathf.Abs(midY - endY) ? startY : endY;
c1.y2 = c2.y0 = closerY;
}
// Verify that all five points are in order.
D.assert(_between(startY, c1.y1, c1.y2));
D.assert(_between(c1.y1, c1.y2, c2.y1));

this.addPath();
this.addPoint(0, 0, PointFlags.corner);
}
ref var path = ref this._paths.array[this._paths.length - 1];
if (path.count > 0) {
ref var pt = ref this._points.array[this._points.length - 1];

y = point.y + y1,
flags = flags,
});
} else {
}
else {
this._addPoint(new PathPoint {
x = point.x + x1,
y = point.y + y1,

public void normalize() {
var points = this._points;
var paths = this._paths;
var paths = this._paths;
for (var j = 0; j < paths.length; j++) {
ref var path = ref paths.array[j];
if (path.count <= 1) {

cvertices += path.count;
}
this._vertices = new List<Vector3>(cvertices);
for (var i = 0; i < paths.length; i++) {
ref var path = ref paths.array[i];

this._expandFill();
var paths = this._paths;
var cindices = 0;
for (var i = 0; i < paths.length; i++) {
ref var path = ref paths.array[i];

this._expandStroke(strokeWidth, lineCap, lineJoin, miterLimit);
var paths = this._paths;
var cindices = 0;
for (var i = 0; i < paths.length; i++) {
ref var path = ref paths.array[i];

12
Runtime/ui/text.cs


int? maxLines = null,
float? fontSize = null,
string fontFamily = null,
float? lineHeight = null, // todo
float? height = null, // todo
string ellipsis = null,
StrutStyle strutStyle = null) {
this.textAlign = textAlign;

this.maxLines = maxLines;
this.fontSize = fontSize;
this.fontFamily = fontFamily;
this.lineHeight = lineHeight;
this.height = height;
this.ellipsis = ellipsis;
this.strutStyle = strutStyle;
}

return this.textAlign == other.textAlign && this.textDirection == other.textDirection &&
this.fontWeight == other.fontWeight && this.fontStyle == other.fontStyle &&
this.maxLines == other.maxLines && this.fontSize.Equals(other.fontSize) &&
string.Equals(this.fontFamily, other.fontFamily) && this.lineHeight.Equals(other.lineHeight) &&
string.Equals(this.fontFamily, other.fontFamily) && this.height.Equals(other.height) &&
string.Equals(this.ellipsis, other.ellipsis);
}

hashCode = (hashCode * 397) ^ this.maxLines.GetHashCode();
hashCode = (hashCode * 397) ^ this.fontSize.GetHashCode();
hashCode = (hashCode * 397) ^ (this.fontFamily != null ? this.fontFamily.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ this.lineHeight.GetHashCode();
hashCode = (hashCode * 397) ^ this.height.GetHashCode();
hashCode = (hashCode * 397) ^ (this.ellipsis != null ? this.ellipsis.GetHashCode() : 0);
return hashCode;
}

fontStyle: this.fontStyle,
fontFamily: this.fontFamily,
fontSize: this.fontSize,
height: this.lineHeight
height: this.height
);
}

public readonly int? maxLines;
public readonly float? fontSize;
public readonly string fontFamily;
public readonly float? lineHeight;
public readonly float? height;
public readonly string ellipsis;
public readonly StrutStyle strutStyle;

5
Runtime/rendering/debug.cs


namespace Unity.UIWidgets.rendering {
public static class RenderingDebugUtils {
public static bool debugCheckElevationsEnabled = false;
}
}

11
Runtime/rendering/debug.cs.meta


fileFormatVersion: 2
guid: bb8359f97867cd54592d13cfe1b1d39a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存