transformValues method

  1. @override
void transformValues()
override

Transforms the x and y values to screen coordinates.

Implementation

@override
void transformValues() {
  points.clear();

  final PointToPixelCallback transformX = series.pointToPixelX;
  final PointToPixelCallback transformY = series.pointToPixelY;

  if (!_x1.isNaN && !_y1.isNaN) {
    points.add(Offset(transformX(_x1, _y1), transformY(_x1, _y1)));
  }

  if (!_x2.isNaN && !_y2.isNaN) {
    startControlX = transformX(_controlX1, _controlY1);
    startControlY = transformY(_controlX1, _controlY1);
    endControlX = transformX(_controlX2, _controlY2);
    endControlY = transformY(_controlX2, _controlY2);
    points.add(Offset(transformX(_x2, _y2), transformY(_x2, _y2)));
  }

  if (points.length > _oldPoints.length) {
    _oldPoints.addAll(points.sublist(_oldPoints.length));
  }
  _oldStartControlX ??= startControlX;
  _oldStartControlY ??= startControlY;
  _oldEndControlX ??= endControlX;
  _oldEndControlY ??= endControlY;
}