Gitea CI / Assemble and validate CI artifacts (push) Successful in 1m47s
Gitea CI / Check code and tests (push) Successful in 7m15s
Gitea CI / Build Android APK (push) Successful in 4m6s
Gitea CI / Build Windows x64 app (push) Successful in 3m34s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m29s
Gitea CI / Gitea CI passed (push) Successful in 1s
Gitea Release / Prepare draft Release (push) Failing after 8s
Gitea Release / Upload Android to draft Release (push) Skipped
Gitea Release / Upload Windows to draft Release (push) Skipped
Gitea Release / Verify and publish Release (push) Skipped
51 lines
1.7 KiB
Dart
51 lines
1.7 KiB
Dart
import 'package:cutdex/features/properties/animation_labels.dart';
|
|
import 'package:cutdex_core/editor.dart';
|
|
import 'package:cutdex_core/timeline/model.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
import 'support/preview_fixture.dart';
|
|
|
|
void main() {
|
|
TestWidgetsFlutterBinding.ensureInitialized();
|
|
test(
|
|
'mask grouped animation retains values, interpolates, and survives undo',
|
|
() async {
|
|
final f = await createPreviewFixture(
|
|
Uri.file('/test/video.mov'),
|
|
clipDuration: RationalTime.seconds(5),
|
|
);
|
|
addTearDown(() async {
|
|
await f.workspace.close();
|
|
await f.directory.delete(recursive: true);
|
|
});
|
|
final sequence = SequenceId('one');
|
|
final id = ElementId('clip');
|
|
final view = f.timeline.view(sequence);
|
|
ClipMaskAnimation at(int seconds) {
|
|
final query = view.version.kernelVersion.query();
|
|
return ClipMaskAnimation(
|
|
query.element(query.elementById(id)!),
|
|
seconds * TimelineClock.ticksPerSecond,
|
|
maskId: 'first',
|
|
);
|
|
}
|
|
|
|
void commit(List<ParameterCurveDto> curves) =>
|
|
f.timeline.commitParameters(
|
|
sequence,
|
|
f.timeline.previewParameters(sequence, id, curves),
|
|
);
|
|
commit(at(0).edit(const ClipMask(shape: ClipMaskShape.rectangle)));
|
|
commit(at(0).toggle(maskChannels['position']!));
|
|
commit(at(2).edit(at(2).value.copyWith(x: .9)));
|
|
expect(at(1).value.x, closeTo(.7, 1e-9));
|
|
expect(at(1).value.y, .5);
|
|
expect(at(2).keyed(maskChannels['position']!), isTrue);
|
|
view.undo();
|
|
expect(at(2).value.x, .5);
|
|
view.redo();
|
|
expect(at(2).value.x, .9);
|
|
},
|
|
);
|
|
}
|