Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c6b930b6d6 |
@@ -694,7 +694,7 @@ function generateTableImage(params) {
|
|||||||
const headerHeight = fontSize * 2.5;
|
const headerHeight = fontSize * 2.5;
|
||||||
const rowHeight = fontSize * 2.2;
|
const rowHeight = fontSize * 2.2;
|
||||||
const titleHeight = title ? fontSize * 3 : 0;
|
const titleHeight = title ? fontSize * 3 : 0;
|
||||||
const tableHeight = headerHeight + rows.length * rowHeight + borderWidth * 2;
|
const tableHeight = headerHeight + rows.length * rowHeight;
|
||||||
const finalHeight = tableHeight + titleHeight;
|
const finalHeight = tableHeight + titleHeight;
|
||||||
|
|
||||||
// 创建正式 canvas
|
// 创建正式 canvas
|
||||||
@@ -763,8 +763,9 @@ function generateTableImage(params) {
|
|||||||
ctx.strokeStyle = themeConfig.borderColor;
|
ctx.strokeStyle = themeConfig.borderColor;
|
||||||
ctx.lineWidth = borderWidth;
|
ctx.lineWidth = borderWidth;
|
||||||
|
|
||||||
// 外边框
|
// 外边框(向内偏移半个线宽,确保边框完全在画布内)
|
||||||
ctx.strokeRect(0, startY, finalWidth, tableHeight);
|
const offset = borderWidth / 2;
|
||||||
|
ctx.strokeRect(offset, startY + offset, finalWidth - borderWidth, tableHeight - borderWidth);
|
||||||
|
|
||||||
// 横线
|
// 横线
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
|
|||||||
Reference in New Issue
Block a user