Skip to content

Commit eff6187

Browse files
committed
fix: declare rectWidth and rectHeight variables before use in drawAvatar method
1 parent 918cdbb commit eff6187

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

utils/quote-generate.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,10 @@ class QuoteGenerate {
850850
textPosY = mediaPosY + mediaHeight + 5 * scale
851851
}
852852

853+
// Declare rectWidth and rectHeight variables before using them
854+
let rectWidth = width - blockPosX
855+
let rectHeight = height
856+
853857
if (mediaType === 'sticker' && (name || replyName)) {
854858
rectHeight = replyName && replyText ? (replyName.height + replyText.height * 0.5) + indent * 2 : indent * 2
855859
backgroundColorOne = backgroundColorTwo = 'rgba(0, 0, 0, 0.5)'
@@ -858,8 +862,6 @@ class QuoteGenerate {
858862
const canvas = createCanvas(width, height)
859863
const canvasCtx = canvas.getContext('2d')
860864

861-
let rectWidth = width - blockPosX
862-
let rectHeight = height
863865
const rectPosX = blockPosX
864866
const rectPosY = blockPosY
865867
const rectRoundRadius = 25 * scale

0 commit comments

Comments
 (0)