translate method
void
translate(
- Point p
)
override
Implementation
@override
void translate(Point p) {
var x = p.x.toInt();
var y = p.y.toInt();
var pathPoints2 = pathPoints;
final length = pathPoints2.length;
for (var i = 0; i < length; ++i) {
var e = pathPoints2[i];
if (e is num) {
var x1 = e;
var y1 = pathPoints2[i + 1] as num;
pathPoints2[i] = x1 + x;
pathPoints2[++i] = y1 + y;
} else if (e is Point) {
pathPoints2[i] = e.incrementXY(x, y);
} else if (e is List<num>) {
var cubic = e.toList(growable: false);
assert(cubic.length == 6);
var x1 = cubic[0];
var y1 = cubic[1];
var x2 = cubic[2];
var y2 = cubic[3];
var x3 = cubic[4];
var y3 = cubic[5];
cubic[0] = x1 + x;
cubic[1] = y1 + y;
cubic[2] = x2 + x;
cubic[3] = y2 + y;
cubic[4] = x3 + x;
cubic[5] = y3 + y;
}
}
}