画布 Crop 编辑:暗区遮罩+三分线+角手柄+平移 + Inspector 开关/宽高比预设(1:1 上游)#178
Merged
Conversation
…t-lock menu Port upstream CropOverlayView.swift + InspectorView cropRow/cropMenu (T3-11): while crop-editing is active for the selected visual clip, the preview canvas swaps TransformOverlay for a CropOverlay — crop rect with dimmed outside, rule- of-thirds guides, 4 corner handles (free or aspect-locked), drag-inside pan — committing once on release (animated crop upserts a keyframe at the playhead). - cropOverlay.ts: pure 1:1 drag math — pannedCrop, resizedCrop (free clamps insets >= 0 with MIN_VISIBLE floor exactly like upstream :144-147; locked drives one visible-width var with per-corner bounds), lockedAspectNormalized, CropAspectLock presets + cropFittingAspect/cropForPreset. 32 unit tests. - CropOverlay.tsx: TransformOverlay's architecture (pointerEvents:none container, window pointer listeners + cleanup, sampledTransform/cropAt rest state, commit-on-release; rotated clips route corner deltas via rotateDeltaIntoLocalFrame). - Preview.tsx: mutually exclusive mount per PreviewContainerView.swift:37-41. - uiStore: cropEditingActive + cropAspectLock; cleared on selection change and on leaving the Video tab (InspectorView.swift:60-68 parity). - Inspector CropSection: crop-edit toggle + aspect preset menu; applyCropPreset branches animated (upsert keyframe) vs static, free = lock-only (no mutation). - dict.ts: zh/en labels. Note: the implementing agent died mid-run (API disconnect); work was recovered, 3 of its tests expected impossible negative insets on an outward drag from the identity crop — rewritten against a non-zero start plus an explicit floor-at-0 assertion (upstream clamps identically). Verified: pnpm build (tsc) clean; pnpm test 324 passed. On-canvas drag still needs a real-machine visual pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
上游 CropOverlayView.swift + InspectorView cropRow/cropMenu 的 1:1 移植。裁剪编辑激活时预览画布用 CropOverlay 替换 TransformOverlay(互斥,PreviewContainerView:37-41);纯几何模块 32 单测;animated crop 走 upsertKeyframe。实现 agent 中途断线,已救回并修正其 3 个符号写反的测试(负 inset 不可能,上游同款 clamp)。本地:build 绿 + 324 测试。画布拖拽待真机目视。