diff --git a/server.js b/server.js index 3cd6ac7..027328e 100644 --- a/server.js +++ b/server.js @@ -694,7 +694,7 @@ function generateTableImage(params) { const headerHeight = fontSize * 2.5; const rowHeight = fontSize * 2.2; const titleHeight = title ? fontSize * 3 : 0; - const tableHeight = headerHeight + rows.length * rowHeight + borderWidth * 2; + const tableHeight = headerHeight + rows.length * rowHeight; const finalHeight = tableHeight + titleHeight; // 创建正式 canvas @@ -763,8 +763,9 @@ function generateTableImage(params) { ctx.strokeStyle = themeConfig.borderColor; ctx.lineWidth = borderWidth; - // 外边框 - ctx.strokeRect(0, startY, finalWidth, tableHeight); + // 外边框(向内偏移半个线宽,确保边框完全在画布内) + const offset = borderWidth / 2; + ctx.strokeRect(offset, startY + offset, finalWidth - borderWidth, tableHeight - borderWidth); // 横线 ctx.beginPath();