|
|
@ -45,10 +45,20 @@ let newWidth = (25 - 5 * 2) * zoom |
|
|
|
let newHeight = (75 - 15 * 2) * zoom |
|
|
|
|
|
|
|
const addSelect = () => { |
|
|
|
// rect.value = new Konva.Rect({ |
|
|
|
// x: 5 * zoom, |
|
|
|
// y: 15 * zoom, |
|
|
|
// width: (25 - 5 * 2) * zoom, |
|
|
|
// height: (75 - 15 * 2) * zoom, |
|
|
|
// fill: 'rgba(238,10,36, 0.2)', |
|
|
|
// draggable: true, |
|
|
|
// }) |
|
|
|
|
|
|
|
// 取消横向选择区域 |
|
|
|
rect.value = new Konva.Rect({ |
|
|
|
x: 5 * zoom, |
|
|
|
x: 0, |
|
|
|
y: 15 * zoom, |
|
|
|
width: (25 - 5 * 2) * zoom, |
|
|
|
width: 25 * zoom, |
|
|
|
height: (75 - 15 * 2) * zoom, |
|
|
|
fill: 'rgba(238,10,36, 0.2)', |
|
|
|
draggable: true, |
|
|
@ -77,7 +87,8 @@ const addSelect = () => { |
|
|
|
rotateEnabled: false, // 禁用旋转手势 |
|
|
|
rotationSnaps: [], // 移除旋转刻度 |
|
|
|
anchorSize: 20, |
|
|
|
enabledAnchors: ['top-center', 'bottom-center', 'middle-left', 'middle-right'], // 关键修改 |
|
|
|
// enabledAnchors: ['top-center', 'bottom-center', 'middle-left', 'middle-right'], // 关键修改 |
|
|
|
enabledAnchors: ['top-center', 'bottom-center'], // 关键修改 |
|
|
|
boundBoxFunc(oldBoundBox, newBoundBox) { |
|
|
|
const stageWidth = stage.value.width() |
|
|
|
const stageHeight = stage.value.height() |
|
|
|