Feat:新增禁止鼠标滚轮缩放的配置
This commit is contained in:
parent
df1aed7e04
commit
12265be7d4
@ -149,5 +149,7 @@ export const defaultOpt = {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
// 如果你的处理逻辑存在异步逻辑,也可以返回一个promise
|
// 如果你的处理逻辑存在异步逻辑,也可以返回一个promise
|
||||||
customHandleClipboardText: null
|
customHandleClipboardText: null,
|
||||||
|
// 禁止鼠标滚轮缩放,你仍旧可以使用api进行缩放
|
||||||
|
disableMouseWheelZoom: false
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,7 +65,8 @@ class View {
|
|||||||
mousewheelAction,
|
mousewheelAction,
|
||||||
mouseScaleCenterUseMousePosition,
|
mouseScaleCenterUseMousePosition,
|
||||||
mousewheelMoveStep,
|
mousewheelMoveStep,
|
||||||
mousewheelZoomActionReverse
|
mousewheelZoomActionReverse,
|
||||||
|
disableMouseWheelZoom
|
||||||
} = this.mindMap.opt
|
} = this.mindMap.opt
|
||||||
// 是否自定义鼠标滚轮事件
|
// 是否自定义鼠标滚轮事件
|
||||||
if (
|
if (
|
||||||
@ -76,6 +77,7 @@ class View {
|
|||||||
}
|
}
|
||||||
// 鼠标滚轮事件控制缩放
|
// 鼠标滚轮事件控制缩放
|
||||||
if (mousewheelAction === CONSTANTS.MOUSE_WHEEL_ACTION.ZOOM) {
|
if (mousewheelAction === CONSTANTS.MOUSE_WHEEL_ACTION.ZOOM) {
|
||||||
|
if (disableMouseWheelZoom) return
|
||||||
let cx = mouseScaleCenterUseMousePosition ? e.clientX : undefined
|
let cx = mouseScaleCenterUseMousePosition ? e.clientX : undefined
|
||||||
let cy = mouseScaleCenterUseMousePosition ? e.clientY : undefined
|
let cy = mouseScaleCenterUseMousePosition ? e.clientY : undefined
|
||||||
switch (dir) {
|
switch (dir) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user