-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix(extension): 优化框选插件,解决默认情况下框选开启后无法对画布做其他操作的问题 #2127
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
Conversation
|
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.
Copilot reviewed 23 out of 23 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
sites/docs/docs/tutorial/extension/selection.zh.md:114
- The method name 'setleExclusiveMode' appears to contain a typo; consider renaming it to 'setExclusiveMode' for consistency with the implementation and the English documentation.
### setleExclusiveMode
packages/extension/src/components/selection-select/index.ts:219
- [nitpick] Consider refactoring the repeated wrapper cleanup logic into a dedicated helper function to improve code clarity and reduce duplication.
if (this.wrapper && this.startPoint && this.endPoint) {
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.
see see
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.
这些文档为什么变动这么多,是用什么工具重写了一下吗?
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.
是的,我用cursor批量「参考中文文档内容补充对应英文文档」了😄
@@ -53,24 +52,10 @@ export class ToolOverlay extends Component<IProps> { | |||
lf.components = [] // 保证extension组件的render只执行一次 | |||
} | |||
|
|||
zoomHandler = (e: WheelEvent) => { |
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.
当时这儿加这个 zoomHandler 的背景是什么?我没太看懂作用,是为了在 ToolOverlay 中操作 Canvas 呗?
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.
差不多是这个诉求,当时是想开启框选之后禁用zoom之外的事件,所以在ToolOverlay里单独加了zoomHandler,实现缩放ToolOverlay的时候触发CanvasOverlay的缩放
removeSelectByElementId => deselectByElementId defaultExclusiveMode => exclusiveMode
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.
优秀
大佬牛逼 👍 发现个问题:现在独占模式下好像没法点击空白处取消框选了 |
我看看 |
确实有这个问题,刚刚改完一版 #2129 ,可以一起再看看 |
重新调整了一下 #2090 的实现
主要做了几个事情(主要需要CR packages目录下的改动,文档和example感兴趣的话可以看一下
@ZivvW 朋友可以一起CRCR😄,看看在你的场景下使用有没有什么问题