확대 축소 시 mouseLine 작아지는 현상 수정
This commit is contained in:
parent
337bd4fc4b
commit
c766428630
@ -37,7 +37,7 @@ export function useEvent() {
|
|||||||
if (zoom > 5) zoom = 5
|
if (zoom > 5) zoom = 5
|
||||||
if (zoom < 0.5) zoom = 0.5
|
if (zoom < 0.5) zoom = 0.5
|
||||||
|
|
||||||
setCanvasZoom((zoom * 100).toFixed(0))
|
setCanvasZoom(Number((zoom * 100).toFixed(0)))
|
||||||
|
|
||||||
// 마우스 위치 기준으로 확대/축소
|
// 마우스 위치 기준으로 확대/축소
|
||||||
canvas.zoomToPoint({ x: opt.e.offsetX, y: opt.e.offsetY }, zoom)
|
canvas.zoomToPoint({ x: opt.e.offsetX, y: opt.e.offsetY }, zoom)
|
||||||
@ -55,7 +55,7 @@ export function useEvent() {
|
|||||||
removeMouseLine()
|
removeMouseLine()
|
||||||
// 가로선
|
// 가로선
|
||||||
const pointer = canvas.getPointer(e.e)
|
const pointer = canvas.getPointer(e.e)
|
||||||
const horizontalLine = new fabric.Line([0, pointer.y, 2 * canvas.width, pointer.y], {
|
const horizontalLine = new fabric.Line([-1 * canvas.width, pointer.y, 2 * canvas.width, pointer.y], {
|
||||||
stroke: 'red',
|
stroke: 'red',
|
||||||
strokeWidth: 1,
|
strokeWidth: 1,
|
||||||
selectable: false,
|
selectable: false,
|
||||||
@ -63,7 +63,7 @@ export function useEvent() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// 세로선
|
// 세로선
|
||||||
const verticalLine = new fabric.Line([pointer.x, 0, pointer.x, 2 * canvas.height], {
|
const verticalLine = new fabric.Line([pointer.x, -1 * canvas.height, pointer.x, 2 * canvas.height], {
|
||||||
stroke: 'red',
|
stroke: 'red',
|
||||||
strokeWidth: 1,
|
strokeWidth: 1,
|
||||||
selectable: false,
|
selectable: false,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user