Skip to content

Commit

Permalink
Merge pull request #348 from xiaoyan428820/release-3.6.8-app
Browse files Browse the repository at this point in the history
fix: canvasToTempFilePath接口fileType为jpg时背景为黑色问题修改
  • Loading branch information
tangcq-code authored Oct 24, 2023
2 parents f321881 + 2bd1bbf commit 506a077
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ export const canvasToTempFilePath: typeof Taro.canvasToTempFilePath = (options,
const ctx = outCanvas.getContext('2d') as CanvasRenderingContext2D
outCanvas.width = destWidth || x
outCanvas.height = destHeight || y
// 设置背景为白色
ctx.fillStyle = '#FFFFFF'
ctx.fillRect(0, 0, outCanvas.width, outCanvas.height)
ctx.drawImage(inCanvas, x, y, width, height, DX, DY, destWidth, destHeight)

try {
Expand Down

0 comments on commit 506a077

Please sign in to comment.