|
|
|
@ -22,23 +22,30 @@ void main() {
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('returns vertices rotated', () {
|
|
|
|
|
const rotationAngle = 2 * math.pi;
|
|
|
|
|
group('rotate', () {
|
|
|
|
|
test('returns vertices rotated', () {
|
|
|
|
|
const rotationAngle = 2 * math.pi;
|
|
|
|
|
final controlPoints = [
|
|
|
|
|
Vector2(0, 0),
|
|
|
|
|
Vector2(10, 0),
|
|
|
|
|
Vector2(0, 10),
|
|
|
|
|
Vector2(10, 10),
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
final bezierCurveShape = BezierCurveShape(
|
|
|
|
|
controlPoints: controlPoints,
|
|
|
|
|
);
|
|
|
|
|
final bezierCurveShapeRotated = BezierCurveShape(
|
|
|
|
|
controlPoints: controlPoints,
|
|
|
|
|
rotation: rotationAngle,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
for (var index = 0; index < bezierCurveShape.vertices.length; index++) {
|
|
|
|
|
expect(
|
|
|
|
|
bezierCurveShape.vertices[index]..rotate(rotationAngle),
|
|
|
|
|
equals(bezierCurveShapeRotated.vertices[index]),
|
|
|
|
|
final bezierCurveShape = BezierCurveShape(
|
|
|
|
|
controlPoints: controlPoints,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
final bezierCurveShapeRotated = BezierCurveShape(
|
|
|
|
|
controlPoints: controlPoints,
|
|
|
|
|
)..rotate(rotationAngle);
|
|
|
|
|
|
|
|
|
|
for (var index = 0; index < bezierCurveShape.vertices.length; index++) {
|
|
|
|
|
expect(
|
|
|
|
|
bezierCurveShape.vertices[index]..rotate(rotationAngle),
|
|
|
|
|
equals(bezierCurveShapeRotated.vertices[index]),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|