|
|
@ -178,7 +178,6 @@ const addGuideLine = () => { |
|
|
|
const getSelection = () => { |
|
|
|
if (rect.value) { |
|
|
|
const pos = rect.value.position() |
|
|
|
console.log(newWidth, newHeight) |
|
|
|
return { |
|
|
|
x1: formatNum(pos.x / zoom), |
|
|
|
y1: formatNum(pos.y / zoom), |
|
|
@ -192,7 +191,6 @@ const getSelection = () => { |
|
|
|
// 新增方法:更新矩形选区位置 |
|
|
|
const updateSelection = (x: number, y: number, width: number, height: number) => { |
|
|
|
if (rect.value) { |
|
|
|
console.log(x, y, width, height) |
|
|
|
rect.value.position({ x, y }) |
|
|
|
rect.value.width(width) |
|
|
|
rect.value.height(height) |
|
|
@ -229,7 +227,6 @@ const updateLine = (point: { x: number, y: number }, index: number, stroke: stri |
|
|
|
} |
|
|
|
nextTick(() => { |
|
|
|
const currentLine = lines.value[index] |
|
|
|
console.log(currentLine, currentLine.points()) |
|
|
|
currentLine.points([...currentLine.points(), point.x, point.y]) |
|
|
|
currentLine.getLayer()!.batchDraw() // 批量重绘提升性能 |
|
|
|
}) |
|
|
|