refreshLyricHeight method
calculate all line draw info
Implementation
refreshLyricHeight(Size size) {
lyricPaint.clearCache();
widget.model?.lyrics.forEach((element) {
var drawInfo = LyricDrawInfo()
..playingExtTextPainter = getTextPaint(
element.extText, widget.ui.getPlayingExtTextStyle(),
size: size)
..otherExtTextPainter = getTextPaint(
element.extText, widget.ui.getOtherExtTextStyle(),
size: size)
..playingMainTextPainter = getTextPaint(
element.mainText, widget.ui.getPlayingMainTextStyle(),
size: size)
..otherMainTextPainter = getTextPaint(
element.mainText, widget.ui.getOtherMainTextStyle(),
size: size);
if (widget.ui.enableHighlight()) {
setTextInlineInfo(drawInfo, widget.ui, element.mainText!);
setTextSpanDrawInfo(
widget.ui,
element.spanList ?? element.defaultSpanList,
TextPainter(
textDirection: TextDirection.ltr,
));
}
element.drawInfo = drawInfo;
});
}