From c158d62453c9bc6dd37ff92205b17fc7fb7b8afc Mon Sep 17 00:00:00 2001 From: ChaoXxxx <474142438@qq.com> Date: Wed, 11 May 2022 10:17:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=8F=96=E8=89=B2?= =?UTF-8?q?=E5=99=A8=E5=90=B8=E5=8F=96=E7=94=BB=E5=B8=83=E6=94=BE=E5=A4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ColorPicker/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ColorPicker/index.vue b/src/components/ColorPicker/index.vue index 317e88fc..8d755cd9 100644 --- a/src/components/ColorPicker/index.vue +++ b/src/components/ColorPicker/index.vue @@ -219,7 +219,7 @@ export default defineComponent({ colorBlockRef.style.cssText = 'position: absolute; top: -100px; left: -100px; width: 16px; height: 16px; border: 1px solid #000; z-index: 999' maskRef.appendChild(colorBlockRef) - const { left, top } = targetRef.getBoundingClientRect() + const { left, top, width, height } = targetRef.getBoundingClientRect() const filter = (node: HTMLElement) => { if (node.tagName && node.tagName.toUpperCase() === 'FOREIGNOBJECT') return false @@ -227,7 +227,7 @@ export default defineComponent({ return true } - toCanvas(targetRef, { filter, fontEmbedCSS: '' }).then(canvasRef => { + toCanvas(targetRef, { filter, fontEmbedCSS: '', width, height, canvasWidth: width, canvasHeight: height, pixelRatio: 1 }).then(canvasRef => { canvasRef.style.cssText = `position: absolute; top: ${top}px; left: ${left}px; cursor: crosshair;` maskRef.style.cursor = 'default' maskRef.appendChild(canvasRef)