-
Notifications
You must be signed in to change notification settings - Fork 53
[201_70] 修复图片缩放的撤销问题 #2730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AXeonV
wants to merge
1
commit into
main
Choose a base branch
from
ty/201_70
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[201_70] 修复图片缩放的撤销问题 #2730
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # [201_70] 修复图片缩放的撤销问题 | ||
|
|
||
| ## 如何测试 | ||
| 1. 新建文档,插入一张图片 | ||
| 2. 鼠标拖动图片的8个调整手柄(四个角和四条边)进行缩放 | ||
| 3. 释放左键后,按住 `Ctrl+Z` 撤销,应该只需要一次就能完全恢复到原始尺寸 | ||
| 4. 连续进行多次独立的拖拽缩放操作(独立指每次拖拽操作之间左键没有释放),每次撤销应该对应一次独立的拖拽操作 | ||
|
|
||
| ## 2026/1/30 | ||
| ### What | ||
| 在图片鼠标拖拽缩放功能中添加编辑会话标记,将整个拖拽过程作为一个事务处理,避免撤销时逐帧回退 | ||
|
|
||
| ### Why | ||
| 原实现中,鼠标拖拽缩放图片时,每帧修改都会调用 `tree-set!` 触发独立的撤销记录,导致用户需要按多次 `Ctrl+Z` 才能完全撤销一次拖拽操作 | ||
|
|
||
| 这不符合用户直觉,每次拖拽应该对应一次撤销操作,与表格格线拖动等操作保持一致 | ||
|
|
||
| ### How | ||
| 1. 在 `format-geometry-edit.scm` 中添加 `image-resize-mark` 全局变量(编辑会话标记) | ||
| 2. 在鼠标开始拖拽时(`start-drag-left`)调用 `(mark-new)` 创建标记并 `(mark-start)` 开始编辑会话 | ||
| 3. 在鼠标结束拖拽时(`end-drag-left`)调用 `(mark-end)` 结束编辑会话,将整个拖拽过程合并为一个撤销记录 | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
测试步骤 4 的括号说明有语义错误:“独立的拖拽操作”一般指每次拖拽之间左键已经释放;当前写成“左键没有释放”会让测试步骤相互矛盾。建议改为“独立指每次拖拽操作之间左键已释放/每次拖拽都先松开左键再开始下一次”。