Skip to content

预览打磨批:画布缩放/平移 + Aspect/Quality/Zoom 交互菜单 + 中心吸附引导线#188

Merged
appergb merged 1 commit into
mainfrom
feat/preview-polish
Jul 3, 2026
Merged

预览打磨批:画布缩放/平移 + Aspect/Quality/Zoom 交互菜单 + 中心吸附引导线#188
appergb merged 1 commit into
mainfrom
feat/preview-polish

Conversation

@appergb

@appergb appergb commented Jul 3, 2026

Copy link
Copy Markdown
Owner

①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 全绿。

…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).
@appergb appergb merged commit ace3236 into main Jul 3, 2026
2 checks passed
@appergb appergb deleted the feat/preview-polish branch July 3, 2026 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant