Skip to content

应用配置

基础     视口类型     画布     点按     多点     触屏     滚轮     平移视图     缩放视图

多点触摸事件相关配置, 应用运行中修改 app.config.multiTouch 立即生效。

注意事项

App 结构 下只能设置在 App 的 config 上。

关键属性

multiTouch.disabled: boolean

是否禁用多点触屏产生的缩放/平移/旋转事件, 默认为 false。

示例

禁用多点触屏功能

ts
// #应用配置 - 禁用多点触屏功能 [Leafer]
import { Leafer, Rect } from 'leafer-ui'

const leafer = new Leafer({
    view: window,
    multiTouch: { disabled: true }
})

leafer.add(Rect.one({ fill: '#32cd79' }, 100, 100))
ts
// #应用配置 - 禁用多点触屏功能 [App]
import { App, Rect } from 'leafer-ui'

const app = new App({
    view: window,
    tree: { multiTouch: { disabled: true } }
})

app.tree.add(Rect.one({ fill: '#32cd79' }, 100, 100))

Released under the MIT License.