From 075b36915c3b40cb57df92a94239888074f472df Mon Sep 17 00:00:00 2001 From: DCloud_LXH <283700113@qq.com> Date: Mon, 9 May 2022 11:16:49 +0800 Subject: [PATCH] chore: canvas --- packages/uni-components/src/helpers/hidpi.js | 1 + packages/uni-components/src/vue/canvas/index.tsx | 7 +------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/uni-components/src/helpers/hidpi.js b/packages/uni-components/src/helpers/hidpi.js index d80261e29..2160663b9 100644 --- a/packages/uni-components/src/helpers/hidpi.js +++ b/packages/uni-components/src/helpers/hidpi.js @@ -55,6 +55,7 @@ export function initHidpi() { translate: 'all', createRadialGradient: 'all', createLinearGradient: 'all', + transform: [4, 5], setTransform: [4, 5], } diff --git a/packages/uni-components/src/vue/canvas/index.tsx b/packages/uni-components/src/vue/canvas/index.tsx index 04d6db323..a408992dd 100644 --- a/packages/uni-components/src/vue/canvas/index.tsx +++ b/packages/uni-components/src/vue/canvas/index.tsx @@ -395,12 +395,7 @@ function useMethods( break } } else { - if (method === 'setTransform' || method === 'transform') { - data[4] && ((data[4] as number) *= _pixelRatio.value) - data[5] && ((data[5] as number) *= _pixelRatio.value) - // @ts-ignore - c2d[method].apply(c2d, data) - } else if (method === 'clip') { + if (method === 'clip') { data.forEach(function (data_) { // @ts-ignore c2d[data_.method].apply(c2d, data_.data) -- GitLab