预览打磨批:画布缩放/平移 + Aspect/Quality/Zoom 交互菜单 + 中心吸附引导线#188
Merged
Conversation
…nap guides Three preview-surface gaps vs upstream PreviewContainerView/PreviewView/ TransformOverlayView: - Canvas zoom + pan: Cmd+scroll zooms around the cursor with upstream's exact math (factor=exp(delta), precise-delta sensitivity 0.005 vs 0.05, clamp [0.1, 8.0], offset reset when zoom <= 1.0, below-fit 0.25 white outline); native non-passive wheel listener (TimelineContainer's documented pattern — React onWheel is passive). Stage scales fittedCanvas x zoom + translate offset. Overlays stay drag-correct because both Transform/Crop overlays multiply normalized fractions by canvasPx AND divide pointer deltas by it — passing the SCALED box preserves the bijection (verified live: 200% box measured exactly 2x fit box). Pure previewZoom.ts, 9 tests. - Interactive badges: Zoom menu (25/50/75/Fit/125/150/200, resets offset then sets zoom), Aspect menu (16:9 1920x1080 / 9:14 / 9:16 / 1:1 / 4:3 / 2.4:1 -> applyTimelineSettings), Quality menu (short edge 720/1080/1440/2160, HD/FHD/ 2K/4K label). previewPresets.ts tables, 11 tests. NEW EditCommand::SetTimelineSettings ports upstream's FPS rescale faithfully: clips processed in start order with a previous_end floor (no overlaps), round()-scaled starts/trims/fades, keyframes rescaled + clamped; dims set; one undo step. 9 engine + 4 command tests; camelCase DTO. Quality honestly documented: honored by composite/capture (+streaming render cap at spawn); the DOM <video> path cannot decode-downscale. - TransformOverlay center guides: pink rgba(255,51,153,0.8) canvas-spanning lines per axis while a move drag snaps to canvas center (unrotated only, cleared on release) via new moveTransformByDeltaWithSnap returning per-axis flags (original helper untouched). 6 snap-flag + 1 negative test. Deferred (documented in settings.rs): playhead rescale on FPS change is UI-owned; auto-refit of fitted clips to a new aspect needs per-asset dims the engine doesn't hold; FPS badge stays read-only; streaming cap not live-updated. Gates: fmt/clippy -D warnings clean; cargo test --workspace 1532; pnpm build clean; pnpm test 423 (+29).
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.
①Cmd+滚轮绕光标缩放(上游 exp 因子/clamp[0.1,8]/≤1 归零 offset/低于适配白描边;原生非被动 wheel 模式);overlay 拖拽在缩放下保持正确(实测 200% 精确 2 倍)②三徽章变菜单(预设表 1:1);新 EditCommand::SetTimelineSettings 忠实 FPS 重缩放(start 排序+previous_end 防重叠,13 测试);Quality 诚实文档化③Transform 中心吸附粉色引导线。门禁:workspace 1532 + web 423 全绿。