diff --git a/convert-w2p.js b/convert-w2p.js index 3a0d4ff..fd4cf78 100644 --- a/convert-w2p.js +++ b/convert-w2p.js @@ -631,8 +631,8 @@ async function convert(input) { }); // ===== 同坐标完全重叠去重:保留后者(高层),仅同类型 ===== - // 额外:IMAGE 节点覆盖的 TEXT 节点也去掉(图片替代文字) - var imageRects = sg.children.filter(c => c.type === 'IMAGE' && c.rect).map(c => ({ + // 额外:IMAGE/RECTANGLE(有背景图) 节点覆盖的 TEXT 节点也去掉 + var imageRects = sg.children.filter(c => (c.type === 'IMAGE' || (c.type === 'RECTANGLE' && c.backgroundImages?.length > 0)) && c.rect).map(c => ({ x: Math.round(c.rect.x), y: Math.round(c.rect.y), w: Math.round(c.rect.w), h: Math.round(c.rect.h), z: parseInt(c.styles?.zIndex) || 0