fix: 效果图渲染歪斜线(Canvas stroke落错路径, 高光四边形被误描边), RenderCanvas/variantRenderer/photoCompose 三处同型缺陷修复
This commit is contained in:
@@ -63,7 +63,11 @@ function render() {
|
||||
ctx.closePath()
|
||||
ctx.fillStyle = grad
|
||||
ctx.fill()
|
||||
// 玻璃斜向高光
|
||||
// 型材线(先于高光描边:stroke 针对当前路径=玻璃多边形)
|
||||
ctx.strokeStyle = '#5c6166'
|
||||
ctx.lineWidth = 2.2
|
||||
ctx.stroke()
|
||||
// 玻璃斜向高光(clip 内绘制,不复用其后路径)
|
||||
ctx.save()
|
||||
ctx.clip()
|
||||
ctx.globalAlpha = 0.16
|
||||
@@ -76,10 +80,6 @@ function render() {
|
||||
ctx.closePath()
|
||||
ctx.fill()
|
||||
ctx.restore()
|
||||
// 型材线
|
||||
ctx.strokeStyle = '#5c6166'
|
||||
ctx.lineWidth = 2.2
|
||||
ctx.stroke()
|
||||
}
|
||||
// 外框
|
||||
const all = dd.sm.flatMap(s => replayShape(s).regions.flat().map(seg => seg.ps))
|
||||
|
||||
@@ -60,6 +60,10 @@ export function renderWindowOnly(w: number, h: number, drawingRaw: string | obje
|
||||
ctx.closePath()
|
||||
ctx.fillStyle = grad
|
||||
ctx.fill()
|
||||
// 型材线(先于高光描边:stroke 针对当前路径=玻璃多边形)
|
||||
ctx.strokeStyle = 'rgba(70,76,84,0.9)'
|
||||
ctx.lineWidth = 2
|
||||
ctx.stroke()
|
||||
ctx.save()
|
||||
ctx.clip()
|
||||
ctx.globalAlpha = 0.2
|
||||
@@ -72,9 +76,6 @@ export function renderWindowOnly(w: number, h: number, drawingRaw: string | obje
|
||||
ctx.closePath()
|
||||
ctx.fill()
|
||||
ctx.restore()
|
||||
ctx.strokeStyle = 'rgba(70,76,84,0.9)'
|
||||
ctx.lineWidth = 2
|
||||
ctx.stroke()
|
||||
}
|
||||
// 中梃: sp 在其作用区域 bbox 内的投影线
|
||||
const regionBBs = regions.map(bboxOf)
|
||||
|
||||
@@ -142,8 +142,12 @@ export function renderAI(
|
||||
ctx.closePath(); ctx.fill()
|
||||
ctx.globalAlpha = 1
|
||||
ctx.restore()
|
||||
// 型材线:重建玻璃多边形路径再描边(restore 后当前路径是反光带,不可直接 stroke)
|
||||
ctx.strokeStyle = pal.frame
|
||||
ctx.lineWidth = 2.4
|
||||
ctx.beginPath()
|
||||
rpts.forEach((p, i) => (i ? ctx.lineTo(tx(p.x), ty(p.y)) : ctx.moveTo(tx(p.x), ty(p.y))))
|
||||
ctx.closePath()
|
||||
ctx.stroke()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user