feat(inspector): edit animated effects, strokes and corner distortion
Replace the shadow-only inspector with layered effect and stroke controls and per-corner distortion editors. Share color inputs, layer rows, keyframe controls and property edit boundaries; keep nested selection menus within their property popover and update localized labels. Add property editing, preview interaction and benchmark comparison coverage. Validation: Dart analysis reports no issues and 160 targeted application tests pass. The macOS development app was rebuilt and visually checked during native rendering validation. Exclude local dependency override changes from the committed lockfile.
This commit is contained in:
1 parent
8d1f8db7e8
commit
789af7a68e
58 files changed
+6911
-1972
No files matched your search
@@ -0,0 +1,89 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:cutdex_sdk/editor.dart';
|
||||
import 'package:cutdex_sdk/preview.dart';
|
||||
import 'package:cutdex_sdk/timeline_ui.dart';
|
||||
import 'package:cutdex_sdk/timeline/engine.dart';
|
||||
import 'package:cutdex_sdk/timeline/model.dart';
|
||||
|
||||
import '../../workspace/timeline_session.dart';
|
||||
|
||||
/// Shared pause, stale-context checks and diagnostics for inspector edits.
|
||||
class PropertyEditBoundary {
|
||||
PropertyEditBoundary(this.session, this.sequence, this.clip);
|
||||
|
||||
final EditorTimelineSession session;
|
||||
final SequenceId sequence;
|
||||
final ElementId clip;
|
||||
bool _disposed = false;
|
||||
bool _busy = false;
|
||||
|
||||
void dispose() => _disposed = true;
|
||||
|
||||
bool canRun(PreviewController? preview) =>
|
||||
!_disposed &&
|
||||
!_busy &&
|
||||
session.activeSequenceId == sequence &&
|
||||
preview?.transforms.hasPending != true;
|
||||
|
||||
Future<bool> run(
|
||||
PreviewController? preview,
|
||||
FutureOr<bool> Function(PropertyEditContext) action, {
|
||||
required String operation,
|
||||
bool Function()? isCurrent,
|
||||
bool seek = false,
|
||||
void Function()? started,
|
||||
}) async {
|
||||
if (!canRun(preview) || isCurrent?.call() == false) return false;
|
||||
final view = session.view(sequence);
|
||||
final target = PropertyEditContext._(
|
||||
tick: view.playheadTick,
|
||||
version: view.version.kernelVersion,
|
||||
current: () =>
|
||||
!_disposed &&
|
||||
isCurrent?.call() != false &&
|
||||
session.activeSequenceId == sequence &&
|
||||
preview?.transforms.hasPending != true,
|
||||
view: view,
|
||||
);
|
||||
_busy = true;
|
||||
try {
|
||||
started?.call();
|
||||
await preview?.pauseForCanvasInteraction();
|
||||
if (!target.isCurrent) return false;
|
||||
if (seek) return await action(target);
|
||||
return await session.runEditAsync(
|
||||
operation,
|
||||
sequence,
|
||||
() async => action(target),
|
||||
context: {
|
||||
'clipIds': [clip.value],
|
||||
'entryPoint': 'property',
|
||||
'playheadTick': target.tick,
|
||||
},
|
||||
);
|
||||
} finally {
|
||||
_busy = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class PropertyEditContext {
|
||||
PropertyEditContext._({
|
||||
required this.tick,
|
||||
required this._version,
|
||||
required this._current,
|
||||
required this._view,
|
||||
});
|
||||
|
||||
final int tick;
|
||||
final TimelineVersion _version;
|
||||
final bool Function() _current;
|
||||
final TimelineViewController _view;
|
||||
|
||||
/// Async operations check this again immediately before publication.
|
||||
bool get isCurrent =>
|
||||
_current() &&
|
||||
_view.playheadTick == tick &&
|
||||
identical(_view.version.kernelVersion, _version);
|
||||
}
|
||||
Reference in new issue
Block a user