Move editor UI into the app and release verified Core dependencies (#14)
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
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
This commit was merged in pull request #14.
This commit is contained in:
1 parent
abc1868550
commit
06f1c26681
452 files changed
+43806
-2329
No files matched your search
@@ -0,0 +1,111 @@
|
||||
part of 'preview_controller.dart';
|
||||
|
||||
/// Uses the same retained GPU frame and deferred publication as mask editing.
|
||||
extension PreviewObscureEditing on PreviewController {
|
||||
bool get obscureDragging => _obscureBase != null;
|
||||
ElementId? get obscureEditingElement =>
|
||||
_editingElement(PreviewCanvasEditMode.obscure);
|
||||
int get obscureEditGeneration => _obscureGeneration;
|
||||
void setObscureEditing(ElementId? id, {Object? owner}) =>
|
||||
_setCanvasEditing(PreviewCanvasEditMode.obscure, id, owner: owner);
|
||||
|
||||
void releaseObscureEditing(Object owner) =>
|
||||
_releaseCanvasEditing(PreviewCanvasEditMode.obscure, owner);
|
||||
|
||||
ClipObscureAnimation? obscureAnimation(ElementId id) {
|
||||
final stack = maskStackFor(id);
|
||||
if (stack == null) return null;
|
||||
final animation = ClipObscureAnimation(stack.record, stack.localTick);
|
||||
return animation.exists ? animation : null;
|
||||
}
|
||||
|
||||
ClipMask? obscureFor(ElementId id) =>
|
||||
id == obscureEditingElement && _pendingObscure != null
|
||||
? _pendingObscure
|
||||
: obscureAnimation(id)?.value;
|
||||
Map<String, double> _obscureValuesFor(ElementId id) => {
|
||||
...?obscureAnimation(id)?.values,
|
||||
if (id == obscureEditingElement && _pendingObscure != null)
|
||||
for (final f in ClipObscureAnimation.channels.expand((c) => c))
|
||||
'obscure.$f': _pendingObscure!.values[f]!,
|
||||
};
|
||||
Future<bool> beginObscureEdit() async {
|
||||
final id = obscureEditingElement;
|
||||
if (id == null ||
|
||||
!canPlay ||
|
||||
_view == null ||
|
||||
obscureAnimation(id)?.containsPlayhead != true ||
|
||||
!_nativeVisuals.any((v) => v.elementId == id)) {
|
||||
return false;
|
||||
}
|
||||
if (transforms.hasPending || _keyframePreviewing) cancelTransform();
|
||||
final generation = ++_obscureGeneration;
|
||||
_obscureBase = _view!.version.kernelVersion;
|
||||
_obscureTick = positionTick;
|
||||
_pendingObscure = obscureAnimation(id)!.value;
|
||||
final bool ready;
|
||||
try {
|
||||
ready = await transforms.ensureContext();
|
||||
} catch (_) {
|
||||
if (generation == _obscureGeneration) cancelObscureEdit();
|
||||
rethrow;
|
||||
}
|
||||
if (!ready || _closed || generation != _obscureGeneration) {
|
||||
if (generation == _obscureGeneration) cancelObscureEdit();
|
||||
return false;
|
||||
}
|
||||
_renderObscure();
|
||||
return true;
|
||||
}
|
||||
|
||||
void _renderObscure() {
|
||||
final id = obscureEditingElement;
|
||||
if (id == null || _transformHandle == null) return;
|
||||
final visual = visualForProperties(id);
|
||||
if (visual != null) _updateTransform(id, visual.transform, () {});
|
||||
}
|
||||
|
||||
void updateObscure(ClipMask next) {
|
||||
if (_obscureBase == null ||
|
||||
!next.isValid ||
|
||||
next.width > 3 ||
|
||||
next.height > 3) {
|
||||
return;
|
||||
}
|
||||
_pendingObscure = next;
|
||||
_renderObscure();
|
||||
_notify();
|
||||
}
|
||||
|
||||
void endObscureEdit() {
|
||||
final id = obscureEditingElement, next = _pendingObscure;
|
||||
try {
|
||||
if (id != null &&
|
||||
next != null &&
|
||||
identical(_obscureBase, _view?.version.kernelVersion) &&
|
||||
_obscureTick == positionTick) {
|
||||
final curves = obscureAnimation(id)!.edit(next);
|
||||
if (curves.isNotEmpty) {
|
||||
void edit() =>
|
||||
timeline.publishParameters(activeSequence()!, id, curves);
|
||||
if (_nativeTransforming) {
|
||||
_publishInteractiveParameters(edit);
|
||||
} else {
|
||||
edit();
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
cancelObscureEdit();
|
||||
}
|
||||
}
|
||||
|
||||
void cancelObscureEdit() {
|
||||
_obscureGeneration++;
|
||||
_obscureBase = null;
|
||||
_obscureTick = null;
|
||||
_pendingObscure = null;
|
||||
_renderObscure();
|
||||
_notify();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user