transformPoints function

List<Map<String, dynamic>> transformPoints(
  1. dynamic points,
  2. dynamic transform
)

Implementation

List<Map<String, dynamic>> transformPoints(points, transform) {
    List<Map<String, dynamic>> newPoints = [];
    for (var i = 0; i < points.length; i += 1) {
        var pt = points[i];
        var newPt = {
            "x": transform.xScale * pt.x + transform.scale01 * pt.y + transform.dx,
            "y": transform.scale10 * pt.x + transform.yScale * pt.y + transform.dy,
            "onCurve": pt.onCurve,
            "lastPointOfContour": pt.lastPointOfContour
        };
        newPoints.add(newPt);
    }

    return newPoints;
}