|
|
@ -6,9 +6,6 @@ import 'package:pinball_components/src/components/components.dart';
|
|
|
|
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
void main() {
|
|
|
|
group('BezierCurveShape', () {
|
|
|
|
group('BezierCurveShape', () {
|
|
|
|
group('rotate', () {
|
|
|
|
|
|
|
|
test('returns vertices rotated', () {
|
|
|
|
|
|
|
|
const rotationAngle = 2 * math.pi;
|
|
|
|
|
|
|
|
final controlPoints = [
|
|
|
|
final controlPoints = [
|
|
|
|
Vector2(0, 0),
|
|
|
|
Vector2(0, 0),
|
|
|
|
Vector2(10, 0),
|
|
|
|
Vector2(10, 0),
|
|
|
@ -16,12 +13,25 @@ void main() {
|
|
|
|
Vector2(10, 10),
|
|
|
|
Vector2(10, 10),
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test('can be instantiated', () {
|
|
|
|
|
|
|
|
expect(
|
|
|
|
|
|
|
|
BezierCurveShape(
|
|
|
|
|
|
|
|
controlPoints: controlPoints,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
isNotNull,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test('returns vertices rotated', () {
|
|
|
|
|
|
|
|
const rotationAngle = 2 * math.pi;
|
|
|
|
|
|
|
|
|
|
|
|
final bezierCurveShape = BezierCurveShape(
|
|
|
|
final bezierCurveShape = BezierCurveShape(
|
|
|
|
controlPoints: controlPoints,
|
|
|
|
controlPoints: controlPoints,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
final bezierCurveShapeRotated = BezierCurveShape(
|
|
|
|
final bezierCurveShapeRotated = BezierCurveShape(
|
|
|
|
controlPoints: controlPoints,
|
|
|
|
controlPoints: controlPoints,
|
|
|
|
)..rotate(rotationAngle);
|
|
|
|
rotation: rotationAngle,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
for (var index = 0; index < bezierCurveShape.vertices.length; index++) {
|
|
|
|
for (var index = 0; index < bezierCurveShape.vertices.length; index++) {
|
|
|
|
expect(
|
|
|
|
expect(
|
|
|
@ -31,5 +41,4 @@ void main() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|