getSpaceHeight static method
获取间距高度
Implementation
static double getSpaceHeight(List<LyricsLineModel>? lyrics, LyricUI ui) {
if (lyrics == null) {
return 0;
}
double sum = lyrics.fold(0.0, (previousValue, element) {
return (previousValue ?? 0) + getLineSpaceHeight(element, ui);
}) ??
0;
//第一行不用加行间距
if (sum > 0) {
sum -= ui.getLineSpace();
}
return sum;
}