From a06e1bdc3d1202d3ba171483be784ad13dd6a1f7 Mon Sep 17 00:00:00 2001 From: R524809 Date: Fri, 5 Dec 2025 17:45:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:2.4.4=20=E4=BB=A3=E7=A0=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- miniprogram/mathPages/service/baseMathDraw.ts | 1 - .../mathPages/service/compareContentDraw.ts | 22 +++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/miniprogram/mathPages/service/baseMathDraw.ts b/miniprogram/mathPages/service/baseMathDraw.ts index 8f618b5..62d958e 100644 --- a/miniprogram/mathPages/service/baseMathDraw.ts +++ b/miniprogram/mathPages/service/baseMathDraw.ts @@ -98,7 +98,6 @@ export class BaseMathDrawService { this.options.subTitle || '找一找下面相同的数字,涂上颜色', }, onHeaderDrawn: (currentY) => { - console.log('onHeaderDrawn currentY', currentY); this.currentY = currentY; }, }); diff --git a/miniprogram/mathPages/service/compareContentDraw.ts b/miniprogram/mathPages/service/compareContentDraw.ts index d744b25..e2b6ef7 100644 --- a/miniprogram/mathPages/service/compareContentDraw.ts +++ b/miniprogram/mathPages/service/compareContentDraw.ts @@ -65,8 +65,8 @@ export async function drawCompareContent({ // 布局参数 const leftMargin = 30; const rightMargin = 30; - const topMargin = 20; - const rowSpacing = 114; // 行之间的间距 + const topMargin = 12; + const rowSpacing = 116; // 行之间的间距 const columnSpacing = 40; // 两列之间的间距(可调节) // 计算每列的宽度(减去边距和列间距) @@ -76,7 +76,7 @@ export async function drawCompareContent({ // 框的尺寸 const boxWidth = 100; - const boxHeight = 98; + const boxHeight = 100; const borderRadius = 12; const circleRadius = 18; // 圆圈半径 @@ -98,11 +98,13 @@ export async function drawCompareContent({ let currentY = startY + topMargin; + // 计算分割线位置(两列中间) + // const dividerX = leftMargin + columnWidth + columnSpacing / 2; + // 固定绘制6行 const totalRows = 6; for (let rowIndex = 0; rowIndex < totalRows; rowIndex++) { const rowY = currentY + rowIndex * rowSpacing; - // 绘制左侧列 const leftProblemIndex = rowIndex * 2; if (leftProblemIndex < problems.length) { @@ -137,6 +139,18 @@ export async function drawCompareContent({ ); } } + + // 绘制中间分割线(贯穿所有行) + // if (totalRows > 0) { + // ctx.strokeStyle = '#999'; + // ctx.lineWidth = 1; + // ctx.beginPath(); + // const dividerStartY = currentY; + // const dividerEndY = currentY + (totalRows - 1) * rowSpacing + boxHeight; + // ctx.moveTo(dividerX, dividerStartY); + // ctx.lineTo(dividerX, dividerEndY); + // ctx.stroke(); + // } } /**