Skip to content
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

求助,双指缩放与画布拖拽有冲突,怎么办? #2813

Closed
gitofzach opened this issue Oct 31, 2022 · 11 comments
Closed

求助,双指缩放与画布拖拽有冲突,怎么办? #2813

gitofzach opened this issue Oct 31, 2022 · 11 comments

Comments

@gitofzach
Copy link

问题描述

issue产生的背景:x6项目是一个平台web项目,有一个app项目通过webView访问该平台web项目。平台web项目为了让app的用户用户体验更好,增加了双指缩放画布大小的功能。但实际效果是,app上使用双指缩放时与画布本身的拖拽功能产生冲突。具体可以看下我上传的视频。

重现链接

重现步骤

1、将x6的web项目做成响应式,并在画布容器上绑定touchstart、 touchend、 touchmove事件(利用这3个事件制作双指缩放功能),画布本身的可拖拽选项为打开状态;
2、手机端通过webView访问web项目,并使用双指缩放功能

预期行为

我期望看到,在移动端,利用双指进行缩放的时候不会与拖拽功能产生冲突

平台

  • 操作系统: [安卓,ios]
  • X6 版本: [1.34.5 ... ]

屏幕截图或视频(可选)

SVID_20221028_153445_1.mp4

补充说明(可选)

No response

@x6-bot
Copy link
Contributor

x6-bot bot commented Oct 31, 2022

👋 @gitofzach

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it.

To help make it easier for us to investigate your issue, please follow the contributing guidelines.

We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@curiousbabyMz
Copy link

如果只是浏览,直接用viewport scalable

@NewByVector
Copy link
Contributor

在 2.x 版本中已经将画布设置为无法双指缩放。https://github.com/antvis/X6/blob/master/packages/x6/src/style/index.less#L9

@hakityc
Copy link

hakityc commented Feb 1, 2023

请问问题解决了吗?我也遇到了类似问题

@NewByVector
Copy link
Contributor

@TANGYICONG 将画布设置为不可缩放

.x6-graph {
  touch-action: none;
}

@cooljser
Copy link

+1,求解

@Momo23015258
Copy link

这个问题你解决了吗,跟你一模一样的需求

@cooljser
Copy link

我解决了,自己手动实现了画布的缩放和组件的拖动

@yanjiez
Copy link

yanjiez commented Aug 23, 2024

为什么X6不做移动端的适配呢?
自己手动的加event的话,如何判断是否pan的是组件,或者是连接桩?

@yanjiez
Copy link

yanjiez commented Aug 26, 2024

我解决了,自己手动实现了画布的缩放和组件的拖动

@cooljser
等于直接禁用X6本身的nodeMovable,自己通过监听touch事件,手动translate node position吗?
请问如何通过xy获取到对应的node呢?

@yanjiez
Copy link

yanjiez commented Aug 26, 2024

@TANGYICONG 将画布设置为不可缩放

.x6-graph {
  touch-action: none;
}

@NewByVector 设为不可缩放的原因是什么?底层有什么冲突么?如果硬要加这双指缩放的功能呢?

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

No branches or pull requests

7 participants