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) {
    points.add(Offset(transformX(_x2, _y2), transformY(_x2, _y2)));
  }

  if (points.length > _oldPoints.length) {
    _oldPoints.addAll(points.sublist(_oldPoints.length));
  }
}