Browse Source

fix: 选区调整和炫酷的操作互不影响

master
guoapeng 3 weeks ago
parent
commit
06c015f707
  1. 16
      src/components/spray/trayGraph/index.vue

16
src/components/spray/trayGraph/index.vue

@ -76,7 +76,8 @@ const addSelect = () => {
}) })
// onMountedrect // onMountedrect
rect.value.on('dragmove', () => {
rect.value.on('dragmove', (event: any) => {
event.cancelBubble = true //
const pos = rect.value.position() const pos = rect.value.position()
const width = newWidth const width = newWidth
const height = newHeight const height = newHeight
@ -91,13 +92,14 @@ const addSelect = () => {
// //
rect.value.position({ x: newX, y: newY }) rect.value.position({ x: newX, y: newY })
layer.value.batchDraw() //
}) })
tr.value = new Konva.Transformer({ tr.value = new Konva.Transformer({
rotationEnabled: false, rotationEnabled: false,
rotateEnabled: false, // rotateEnabled: false, //
rotationSnaps: [], //
anchorSize: 20,
// rotationSnaps: [], //
anchorSize: 25,
// enabledAnchors: ['top-center', 'bottom-center', 'middle-left', 'middle-right'], // // enabledAnchors: ['top-center', 'bottom-center', 'middle-left', 'middle-right'], //
enabledAnchors: props.editSelect ? ['top-center', 'bottom-center', 'middle-left', 'middle-right'] : [], enabledAnchors: props.editSelect ? ['top-center', 'bottom-center', 'middle-left', 'middle-right'] : [],
boundBoxFunc(oldBoundBox, newBoundBox) { boundBoxFunc(oldBoundBox, newBoundBox) {
@ -121,6 +123,14 @@ const addSelect = () => {
return newBoundBox return newBoundBox
}, },
}) })
// Transformer
tr.value.on('dragmove', (event: any) => {
event.cancelBubble = true //
})
tr.value.on('dragend', (event: any) => {
event.cancelBubble = true //
})
layer.value.add(rect.value) layer.value.add(rect.value)
layer.value.add(tr.value) layer.value.add(tr.value)

Loading…
Cancel
Save