Repository navigation
Conversation
maximizeZoom 旧实现按指针相对图片中心的偏移累加 tx/ty,角落指针会把图片 推出视口。改为只改 scale、不动平移:缩放写进布局宽高,图片中心天然保持 不动,平移仅由拖动改。四条入口(滚轮/捏合/±按钮/独立页签)一致。 新增 e2e/image-zoom-center.spec.ts:四角+中心真实 wheel 缩放,断言图片 中心相对视口中心偏移 ≤1.5px 且不出视口;并覆盖缩放后拖动平移仍生效。
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.
关联
fixes #1982
影响
图片放大层(双击查看)缩放改为始终以图片中心为锚点,四角滚轮/捏合不再把图片推出视口;缩放后拖动平移保留。四条入口(滚轮/捏合/±/独立页签)共用
maximizeZoom,自动一致。验证(先红后绿)
tl 中心 x 偏移期望 ≤1.5,实测 457.8 → 失败e2e/image-zoom-center.spec.ts4 passed(四角 + 中心 + 平移解耦 + ±按钮)npx tsc --noEmit0;npx eslint src/0 error;vitest32 passedimage-maximize-reset清 crop 按钮,stash 对照确认与本改动无关)备注
WKWebView 真机指针/滚轮时序可能与 headless 不同,最终观感需真机确认(AGENTS.md 平台差异)。