getRight static method

double getRight(
  1. List<Lyric> lyricArray, [
  2. bool presumeConnectorNeeded = false
])

Implementation

static double getRight(
  List<Lyric> lyricArray, [
  bool presumeConnectorNeeded = false,
]) {
  if (lyricArray.isEmpty) return double.nan;
  var x = -double.maxFinite;
  for (final lyric in lyricArray) {
    x = math.max(
      x,
      lyric.notation!.bounds.x +
          lyric.bounds.x +
          lyric.bounds.width +
          (presumeConnectorNeeded &&
                  lyric.allowsConnector &&
                  !lyric.needsConnector
              ? lyric.getConnectorWidth()
              : 0),
    );
  }
  return x;
}