feat(ticket-order): 修改绘图路径为直线连接各点
简化代码逻辑,移除多余的中间变量计算
This commit is contained in:
+1
-4
@@ -243,10 +243,7 @@
|
||||
|
||||
let d = `M ${pts[0].x} ${pts[0].y}`;
|
||||
for (let i = 1; i < pts.length; i++) {
|
||||
const prev = pts[i-1];
|
||||
const curr = pts[i];
|
||||
const midX = (prev.x + curr.x) / 2;
|
||||
d += ` C ${midX} ${prev.y}, ${midX} ${curr.y}, ${curr.x} ${curr.y}`;
|
||||
d += ` L ${pts[i].x} ${pts[i].y}`;
|
||||
}
|
||||
svgContent += `<path d="${d}" fill="none" stroke="${li.color}" stroke-width="8" stroke-linecap="round" stroke-linejoin="round" />`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user