TextComponent shadows are not affected by OpacityEffect
Los mantenedores suelen responder en 1 día
@spydon ya está trabajando en esto.
Desde el 8/9/2026.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 72/100
Línea de trabajo
Comienza con TextComponent.onChanged y TextPaint.copyWithPaint, donde OpacityEffect actualiza el paint. Sigue cómo se copian TextStyle.shadows y el color de primer plano con estilo, y añade cobertura para el desvanecimiento de texto coloreado con sombras. Se considera completado cuando el texto y sus sombras se desvanecen juntos sin el cambio brusco del color inicial.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
When an OpacityEffect runs on a TextComponent whose TextPaint style defines shadows, the glyph color fades but the shadows keep their original alpha. The shadows stay at full strength for the whole animation, so a fading text leaves a non-fading shadow or glow behind, which reads as a visual glitch.
There is also a related gotcha in the same code path: the first time the effect updates the paint, the style's fill color is replaced entirely by the component's HasPaint paint (white by default), so a colored text visibly snaps to white when the fade begins unless the user remembers to seed paint.color with the same color as the style.
Cause
TextComponent.onChanged applies opacity through TextRenderer.copyWithPaint, and TextPaint.copyWithPaint only swaps the style's foreground:
@override
TextRenderer copyWithPaint(Paint paint) {
return copyWith(
(style) {
return style.copyWith(
foreground: paint,
);
},
);
}
style.shadows is left untouched, so shadow alpha never follows the component's opacity.
Steps to reproduce
final text = TextComponent(
text: '+1 kr',
textRenderer: TextPaint(
style: const TextStyle(
color: Color(0xFF2E9940),
shadows: [Shadow(color: Color(0x99FFFFFF), blurRadius: 4)],
),
),
)..add(OpacityEffect.fadeOut(EffectController(duration: 1)));
Expected behavior
The text and its shadows fade out together, in the text's own color.
Actual behavior
The text snaps to white when the effect starts (foreground paint replaces the style color) and fades, while the white shadow stays at constant alpha until the component is removed.
Suggested fix
In TextPaint.copyWithPaint, scale each shadow's color alpha by the incoming paint's alpha (and consider multiplying the paint color into the existing style color instead of replacing it, so OpacityEffect composes with a styled color the way it does for sprites).
Observed on the perf/component-set-backing branch, but the copyWithPaint implementation is the same on main.
- Lenguaje dominante
- Dart
- Estrellas
- 10.8k
- Forks
- 1.1k
- Merge medio
- 1 d 15 h
- PR fusionados (30 d)
- 50
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de flame-engine/flame
-
flame_tiled: tileset image in a subfolder of an external .tsx resolves to the wrong pathPosiblemente ocupada @ufrshubham la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
flame-engine/flame#4117 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
enhancement v2
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
flame-engine/flame#4116 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
flame-engine/flame#4063 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
flame-engine/flame#4012 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
flame-engine/flame#3974 · 6 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
Todos los issues de flame-engine/flame
Issues similares
-
[Bug] Windows:开启 Flutter windowing 后对话框被提升为原生窗口,首个 ShowWindow 死锁导致整个应用卡死(设置 → 远程访问端口 100% 复现)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
AimesSoft/NipaPlay-Reload#1021 ·
Los mantenedores suelen responder en 1 día
-
enhancement triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
fluttercommunity/plus_plugins#4004 ·
Los mantenedores suelen responder en 1 día
-
agent:ready bug P2 · 中 健壮性 区域: 启动与合规 待验证 隐私与合规
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
ASDW51/DanmuFloat#106 ·
Los mantenedores suelen responder en 1 día
-
c: proposal p: go_router package team-ecosystem
Dificultad 2/5 1-3 horas Aptitud para principiantes 60/100
flutter/flutter#194542 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
enhancement good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100