previousNPath method

Path previousNPath(
  1. int n
)

Implementation

Path previousNPath(int n) {
  Path previousPath = Path.from(this, growable: true);
  if (isEmpty) {
    return previousPath;
  }
  final last = previousPath.last;
  return previousPath
    ..removeLast()
    ..add(max(0, last - n));
}