Feat:新增禁止双指缩放画布的配置信息
This commit is contained in:
parent
a1ec72b401
commit
e0d46055a7
@ -160,6 +160,9 @@ export const defaultOpt = {
|
|||||||
customHandleClipboardText: null,
|
customHandleClipboardText: null,
|
||||||
// 禁止鼠标滚轮缩放,你仍旧可以使用api进行缩放
|
// 禁止鼠标滚轮缩放,你仍旧可以使用api进行缩放
|
||||||
disableMouseWheelZoom: false,
|
disableMouseWheelZoom: false,
|
||||||
|
// 禁止双指缩放,你仍旧可以使用api进行缩放
|
||||||
|
// 需要注册TouchEvent插件后生效
|
||||||
|
disableTouchZoom: false,
|
||||||
// 错误处理函数
|
// 错误处理函数
|
||||||
errorHandler: (code, error) => {
|
errorHandler: (code, error) => {
|
||||||
console.error(code, error)
|
console.error(code, error)
|
||||||
|
|||||||
@ -48,6 +48,7 @@ class TouchEvent {
|
|||||||
let touch = e.touches[0]
|
let touch = e.touches[0]
|
||||||
this.dispatchMouseEvent('mousemove', touch.target, touch)
|
this.dispatchMouseEvent('mousemove', touch.target, touch)
|
||||||
} else if (len === 2) {
|
} else if (len === 2) {
|
||||||
|
if (this.mindMap.opt.disableTouchZoom) return
|
||||||
let touch1 = e.touches[0]
|
let touch1 = e.touches[0]
|
||||||
let touch2 = e.touches[1]
|
let touch2 = e.touches[1]
|
||||||
let ox = touch1.clientX - touch2.clientX
|
let ox = touch1.clientX - touch2.clientX
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user