-
Notifications
You must be signed in to change notification settings - Fork 393
Feat movable支持缩放 #2062
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
base: master
Are you sure you want to change the base?
Feat movable支持缩放 #2062
Conversation
| const { layoutRef, layoutStyle, layoutProps } = useLayout({ props, hasSelfPercent, setWidth, setHeight, nodeRef: movableAreaRef }) | ||
|
|
||
| // 创建缩放手势 | ||
| const scaleGesture = useMemo(() => { |
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.
这个手势为啥是在area里创建的?
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.
感觉没必要走广播的模式啊
| } | ||
|
|
||
| if (bindscale) { | ||
| runOnJS(handleTriggerScale)({ |
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.
runOnJS内存泄漏处理
|
|
||
| // 添加缩放手势支持 | ||
| if (scale && !MovableAreaLayout.scaleArea) { | ||
| const gesturePinch = Gesture.Pinch() |
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.
为啥里外都需要加手势?
| }) | ||
|
|
||
| // 根据手指数量自动区分手势:一指移动,两指缩放 | ||
| return Gesture.Exclusive(gesturePan, gesturePinch) |
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.
手势互斥的方式确定一下,用maxPointer还是exclusive
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.
应该不需要限制minPointers吧
Feat: 调整 movable 缩放交互
No description provided.