Skip to content

Conversation

@yandadaFreedom
Copy link
Collaborator

No description provided.

const { layoutRef, layoutStyle, layoutProps } = useLayout({ props, hasSelfPercent, setWidth, setHeight, nodeRef: movableAreaRef })

// 创建缩放手势
const scaleGesture = useMemo(() => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个手势为啥是在area里创建的?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感觉没必要走广播的模式啊

}

if (bindscale) {
runOnJS(handleTriggerScale)({
Copy link
Collaborator

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()
Copy link
Collaborator

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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

手势互斥的方式确定一下,用maxPointer还是exclusive

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该不需要限制minPointers吧

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.

3 participants