getLineOffsetX method

double getLineOffsetX(
  1. TextPainter textPainter
)

获取行绘制横向坐标

Implementation

double getLineOffsetX(TextPainter textPainter) {
  switch (lyricUI.getLyricHorizontalAlign()) {
    case LyricAlign.LEFT:
      return 0;
    case LyricAlign.CENTER:
      return (mSize.width - textPainter.width) / 2;
    case LyricAlign.RIGHT:
      return mSize.width - textPainter.width;
    default:
      return (mSize.width - textPainter.width) / 2;
  }
}