Fix:修复画布距浏览器窗口左上角不为0时鼠标缩放时不以鼠标为中心的问题
This commit is contained in:
parent
12265be7d4
commit
3757622521
@ -78,8 +78,9 @@ class View {
|
|||||||
// 鼠标滚轮事件控制缩放
|
// 鼠标滚轮事件控制缩放
|
||||||
if (mousewheelAction === CONSTANTS.MOUSE_WHEEL_ACTION.ZOOM) {
|
if (mousewheelAction === CONSTANTS.MOUSE_WHEEL_ACTION.ZOOM) {
|
||||||
if (disableMouseWheelZoom) return
|
if (disableMouseWheelZoom) return
|
||||||
let cx = mouseScaleCenterUseMousePosition ? e.clientX : undefined
|
const { x: clientX, y: clientY } = this.mindMap.toPos(e.clientX, e.clientY)
|
||||||
let cy = mouseScaleCenterUseMousePosition ? e.clientY : undefined
|
let cx = mouseScaleCenterUseMousePosition ? clientX : undefined
|
||||||
|
let cy = mouseScaleCenterUseMousePosition ? clientY : undefined
|
||||||
switch (dir) {
|
switch (dir) {
|
||||||
// 鼠标滚轮,向上和向左,都是缩小
|
// 鼠标滚轮,向上和向左,都是缩小
|
||||||
case CONSTANTS.DIR.UP:
|
case CONSTANTS.DIR.UP:
|
||||||
|
|||||||
@ -303,7 +303,24 @@ export default {
|
|||||||
// })
|
// })
|
||||||
// comp.$mount(el)
|
// comp.$mount(el)
|
||||||
// return comp.$el
|
// return comp.$el
|
||||||
// }
|
// },
|
||||||
|
// 示例3:普通元素
|
||||||
|
// customCreateNodeContent: (node) => {
|
||||||
|
// let el = document.createElement('div')
|
||||||
|
// el.style.cssText = `
|
||||||
|
// width: 203px;
|
||||||
|
// height: 78px;
|
||||||
|
// opacity: 0.8;
|
||||||
|
// background-image: linear-gradient(0deg, rgba(53,130,172,0.06) 0%, rgba(24,75,116,0.06) 100%);
|
||||||
|
// box-shadow: inset 0 1px 15px 0 rgba(119,196,255,0.40);
|
||||||
|
// border-radius: 2px;
|
||||||
|
// display: flex;
|
||||||
|
// justify-content: center;
|
||||||
|
// align-items: center;
|
||||||
|
// `
|
||||||
|
// el.innerHTML = node.nodeData.data.text
|
||||||
|
// return el
|
||||||
|
// },
|
||||||
})
|
})
|
||||||
if (this.openNodeRichText) this.addRichTextPlugin()
|
if (this.openNodeRichText) this.addRichTextPlugin()
|
||||||
this.mindMap.keyCommand.addShortcut('Control+s', () => {
|
this.mindMap.keyCommand.addShortcut('Control+s', () => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user