diff --git a/convert-w2p.js b/convert-w2p.js index 09b1354..c3c443d 100644 --- a/convert-w2p.js +++ b/convert-w2p.js @@ -559,11 +559,9 @@ function convert(input) { } } - // 宽度:顶层元素用 contentW,嵌套元素用 parentW,加最小宽度保障 + // 宽度:parentW 超过 contentW 的 80% 时视为顶层,用 contentW;否则用 parentW var textW = n.parentW || r.w; - if (n._depth === 1) { - textW = contentW; // 顶层文字用 slide 内容宽度 - } + if (textW > contentW * 0.8) textW = contentW; if (textW > contentW) textW = contentW; if (textW < 108) textW = 108; // 最小 1.5in = 108px // 确保 x + w 不超出 slide 内容区右边界