Add runtime text shadow support
This commit is contained in:
@@ -968,6 +968,7 @@ class RuntimeComponent extends PositionComponent
|
||||
fontWeight: node.type == RuntimeNodeType.button
|
||||
? FontWeight.w600
|
||||
: FontWeight.normal,
|
||||
shadows: _textShadows(node),
|
||||
);
|
||||
|
||||
final component = _textComponent;
|
||||
@@ -1033,6 +1034,23 @@ class RuntimeComponent extends PositionComponent
|
||||
return (node.text ?? '').contains('\n');
|
||||
}
|
||||
|
||||
List<Shadow>? _textShadows(RuntimeNode node) {
|
||||
final color = node.textShadowColor;
|
||||
if (color == null) {
|
||||
return null;
|
||||
}
|
||||
return [
|
||||
Shadow(
|
||||
color: composeRuntimeColorAlpha(color, renderAlpha),
|
||||
offset: Offset(
|
||||
node.textShadowOffsetX ?? 0,
|
||||
node.textShadowOffsetY ?? 0,
|
||||
),
|
||||
blurRadius: node.textShadowBlur ?? 0,
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
Color _textColor(RuntimeNode node) {
|
||||
if (node.type == RuntimeNodeType.button) {
|
||||
return Colors.white;
|
||||
|
||||
Reference in New Issue
Block a user