修复签章浮动靠左问题

This commit is contained in:
lihansani
2026-07-20 16:43:08 +08:00
parent 7affeaa253
commit bc8e564aa7
701 changed files with 71380 additions and 25 deletions

View File

@@ -402,6 +402,14 @@
<label>放宽段落布局<span class="htip" tabindex="0">?<span class="htip-body">true默认当签名位置段落有固定行高lineRule=exact或表格行有固定行高hRule=exact小于签名高度时自动把约束改为 atLeast 并上调数值,让签名按设定尺寸完整显示,避免被 Word 硬裁剪。仅作用于段落直接格式不修改样式。false=严格保留原文档布局,签名被缩放到约束内(可能很小)。</span></span></label>
<select id="relaxLayout"><option value="true">true</option><option value="false">false</option></select>
</div>
<div>
<label>签名图模式<span class="htip" tabindex="0">?<span class="htip-body">控制 is_signature=True 的签名图如何插入文档:嵌入式(默认):签名占文档流位置,超出区域时撑大当前行(不影响邻行);浮动覆盖:签名浮在文字上,超出区域不撑大当前行(可能覆盖邻行),适合签名抠图后较大、不想撑破文档布局的场景。</span></span></label>
<select id="signatureMode"><option value="inline">嵌入式(默认)</option><option value="anchor">浮动覆盖</option></select>
</div>
<div>
<label>盖章图模式<span class="htip" tabindex="0">?<span class="htip-body">控制 is_signature=False 的盖章图如何插入文档:浮动覆盖(默认):公章盖住原文字 + 上下相邻行的文字,模拟真人盖章效果;嵌入式:公章占文档流位置(旧行为,不盖文字)。</span></span></label>
<select id="stampMode"><option value="anchor">浮动覆盖(默认)</option><option value="inline">嵌入式</option></select>
</div>
</div>
<div class="actions">
<button id="addStamp">新增盖章项</button>
@@ -778,6 +786,8 @@
rotate_min: numberOrNull($("globalRotateMin").value),
rotate_max: numberOrNull($("globalRotateMax").value),
relax_layout: boolValue("relaxLayout"),
signature_mode: $("signatureMode").value,
stamp_mode: $("stampMode").value,
stamps: mode === "auto" && boolValue("autoScanAll") ? [] : state.stamps.map(stampPayload)
};
$("jsonPreview").textContent = pretty(payload);
@@ -1127,7 +1137,9 @@
use_global_rotate: boolValue("useGlobalRotate"),
rotate_min: numberOrNull($("globalRotateMin").value),
rotate_max: numberOrNull($("globalRotateMax").value),
relax_layout: boolValue("relaxLayout")
relax_layout: boolValue("relaxLayout"),
signature_mode: $("signatureMode").value,
stamp_mode: $("stampMode").value
}
})
});
@@ -1479,7 +1491,7 @@
if (target.id === "clearLogs") { $("logs").innerHTML = ""; state.lastLogId = 0; }
});
["matchMode", "autoScanAll", "useGlobalAlign", "alignH", "alignV", "useGlobalHeight", "globalHeight", "useGlobalNoise", "globalNoise", "useGlobalRotate", "globalRotateMin", "globalRotateMax", "relaxLayout"].forEach((id) => {
["matchMode", "autoScanAll", "useGlobalAlign", "alignH", "alignV", "useGlobalHeight", "globalHeight", "useGlobalNoise", "globalNoise", "useGlobalRotate", "globalRotateMin", "globalRotateMax", "relaxLayout", "signatureMode", "stampMode"].forEach((id) => {
$(id).addEventListener("change", buildPayload);
$(id).addEventListener("input", buildPayload);
});