|
|
|
|
|
|
public readonly Paint foreground; |
|
|
|
public readonly Paint background; |
|
|
|
public readonly string fontFamily; |
|
|
|
public readonly List<BoxShadow> shadows; |
|
|
|
|
|
|
|
public List<string> fontFamilyFallback { |
|
|
|
get { return this._fontFamilyFallback; } |
|
|
|
|
|
|
float? decorationThickness = null, |
|
|
|
string fontFamily = null, |
|
|
|
List<string> fontFamilyFallback = null, |
|
|
|
List<BoxShadow> shadows = null, |
|
|
|
string debugLabel = null) { |
|
|
|
D.assert(color == null || foreground == null, () => _kColorForegroundWarning); |
|
|
|
D.assert(backgroundColor == null || background == null, () => _kColorBackgroundWarning); |
|
|
|
|
|
|
this.debugLabel = debugLabel; |
|
|
|
this.foreground = foreground; |
|
|
|
this.background = background; |
|
|
|
this.shadows = shadows; |
|
|
|
if (this.inherit != other.inherit || this.fontFamily != other.fontFamily |
|
|
|
|| this.fontSize != other.fontSize || this.fontWeight != other.fontWeight |
|
|
|
|| this.fontStyle != other.fontStyle || |
|
|
|
this.letterSpacing != other.letterSpacing |
|
|
|
|| this.wordSpacing != other.wordSpacing || |
|
|
|
this.textBaseline != other.textBaseline |
|
|
|
|| this.height != other.height || this.background != other.background) { |
|
|
|
if (this.inherit != other.inherit || this.fontFamily != other.fontFamily || |
|
|
|
this.fontSize != other.fontSize || this.fontWeight != other.fontWeight || |
|
|
|
this.fontStyle != other.fontStyle || this.letterSpacing != other.letterSpacing || |
|
|
|
this.wordSpacing != other.wordSpacing || this.textBaseline != other.textBaseline || |
|
|
|
this.height != other.height || this.background != other.background || |
|
|
|
this.shadows.equalsList(other.shadows)) { |
|
|
|
this.decorationColor != other.decorationColor |
|
|
|
|| this.decorationStyle != other.decorationStyle) { |
|
|
|
this.decorationColor != other.decorationColor || |
|
|
|
this.decorationStyle != other.decorationStyle) { |
|
|
|
return RenderComparison.paint; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
float decorationThicknessDelta = 0.0f, |
|
|
|
string fontFamily = null, |
|
|
|
List<string> fontFamilyFallback = null, |
|
|
|
List<BoxShadow> shadows = null, |
|
|
|
float fontSizeFactor = 1.0f, |
|
|
|
float fontSizeDelta = 0.0f, |
|
|
|
int fontWeightDelta = 0, |
|
|
|
|
|
|
decorationThickness: this.decorationThickness == null |
|
|
|
? null |
|
|
|
: this.decorationThickness * decorationThicknessFactor + decorationThicknessDelta, |
|
|
|
shadows: shadows ?? this.shadows, |
|
|
|
debugLabel: modifiedDebugLabel |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
decorationColor: other.decorationColor, |
|
|
|
decorationStyle: other.decorationStyle, |
|
|
|
decorationThickness: other.decorationThickness, |
|
|
|
shadows: other.shadows, |
|
|
|
debugLabel: mergedDebugLabel |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
Color decorationColor = null, |
|
|
|
TextDecorationStyle? decorationStyle = null, |
|
|
|
float? decorationThickness = null, |
|
|
|
List<BoxShadow> shadows = null, |
|
|
|
string debugLabel = null) { |
|
|
|
D.assert(color == null || foreground == null, () => _kColorForegroundWarning); |
|
|
|
D.assert(backgroundColor == null || background == null, () => _kColorBackgroundWarning); |
|
|
|
|
|
|
decorationThickness: decorationThickness ?? this.decorationThickness, |
|
|
|
foreground: foreground ?? this.foreground, |
|
|
|
background: background ?? this.background, |
|
|
|
shadows: shadows ?? this.shadows, |
|
|
|
debugLabel: newDebugLabel |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
decorationColor: Color.lerp(null, b.decorationColor, t), |
|
|
|
decorationStyle: t < 0.5f ? null : b.decorationStyle, |
|
|
|
decorationThickness: t < 0.5f ? null : b.decorationThickness, |
|
|
|
shadows: t < 0.5f ? null : b.shadows, |
|
|
|
debugLabel: lerpDebugLabel |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
decorationColor: Color.lerp(a.decorationColor, null, t), |
|
|
|
decorationStyle: t < 0.5f ? a.decorationStyle : null, |
|
|
|
decorationThickness: t < 0.5f ? a.decorationThickness : null, |
|
|
|
shadows: t < 0.5f ? a.shadows : null, |
|
|
|
debugLabel: lerpDebugLabel |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
decorationThickness: MathUtils.lerpFloat( |
|
|
|
a.decorationThickness ?? b.decorationThickness ?? 0.0f, |
|
|
|
b.decorationThickness ?? a.decorationThickness ?? 0.0f, t), |
|
|
|
shadows: t < 0.5f ? a.shadows : b.shadows, |
|
|
|
debugLabel: lerpDebugLabel |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
this.decorationThickness == other.decorationThickness && |
|
|
|
Equals(this.foreground, other.foreground) && |
|
|
|
Equals(this.background, other.background) && |
|
|
|
CollectionUtils.equalsList(this.fontFamilyFallback, other.fontFamilyFallback) && |
|
|
|
this.fontFamilyFallback.equalsList(other.fontFamilyFallback) && |
|
|
|
this.shadows.equalsList(other.shadows) && |
|
|
|
string.Equals(this.fontFamily, other.fontFamily); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
hashCode = (hashCode * 397) ^ (this.fontFamily != null ? this.fontFamily.GetHashCode() : 0); |
|
|
|
hashCode = (hashCode * 397) ^ |
|
|
|
(this.fontFamilyFallback != null ? this.fontFamilyFallback.GetHashCode() : 0); |
|
|
|
hashCode = (hashCode * 397) ^ (this.shadows != null ? this.shadows.GetHashCode() : 0); |
|
|
|
return hashCode; |
|
|
|
} |
|
|
|
} |
|
|
|