@sw7d/paper-renderer 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/paper-renderer.js +4 -4
- package/package.json +1 -1
package/dist/paper-renderer.js
CHANGED
|
@@ -654,14 +654,14 @@ function Se(e, t, n, r, i, a, o, s) {
|
|
|
654
654
|
return ` <g class="swed-formula" transform="translate(${t.toFixed(2)}, ${o})">\n${r.svgContent} </g>\n`;
|
|
655
655
|
}
|
|
656
656
|
case "underline": {
|
|
657
|
-
let r = e, i = (n - 30 / 2).toFixed(2), o = 30 .toFixed(2), s = r.topicId ? ` topicid="${r.topicId}" real-index="${r.realIndex ?? 0}" id="${r.topicId}-${r.realIndex ?? 0}"` : "", c = r.id ? ` data-underline-id="${r.id}"` : "", l = r.blankType ? ` data-blank-type="${r.blankType}"` : "", u = a === "edit" ? `<rect class="swed-underline-hitarea" x="0" y="0" width="${r.width.toFixed(2)}" height="30" fill="transparent" opacity="0"></rect>\n` : "";
|
|
658
|
-
if (
|
|
657
|
+
let r = e, i = (n - 30 / 2).toFixed(2), o = 30 .toFixed(2), s = r.topicId ? ` topicid="${r.topicId}" real-index="${r.realIndex ?? 0}" id="${r.topicId}-${r.realIndex ?? 0}"` : "", c = r.id ? ` data-underline-id="${r.id}"` : "", l = r.blankType ? ` data-blank-type="${r.blankType}"` : "", u = a === "edit" ? `<rect class="swed-underline-hitarea" x="0" y="0" width="${r.width.toFixed(2)}" height="30" fill="transparent" opacity="0"></rect>\n` : "", d = (r.isEmpty || !!r.blankType) && !r.isSplitPart, f = !r.blankType || r.blankType === "tiankong";
|
|
658
|
+
if (d) {
|
|
659
659
|
let e = (42 / 2).toFixed(2), n = a === "edit" ? `<rect x="0" y="0" width="${r.width.toFixed(2)}" height="30" fill="rgb(245,245,245)" opacity="1"></rect>\n` : "", d = a === "edit" ? `<text font-size="12" text-anchor="middle" font-family="'Times New Roman',SimSun,STSong" fill="#aaa" fill-opacity="1" x="${(r.width / 2).toFixed(2)}" y="${e}">${V(r.placeholder)}</text>\n` : "";
|
|
660
|
-
return ` <g class="swed-underline" transform="translate(${t.toFixed(2)}, ${i})"${s}${c}${l}>\n ${u} ${n} ${d} <line x1="2" y1="${o}" x2="${(r.width - 2).toFixed(2)}" y2="${o}" style="stroke:#000;stroke-width:0.7"></line>\n </g>\n
|
|
660
|
+
return ` <g class="swed-underline" transform="translate(${t.toFixed(2)}, ${i})"${s}${c}${l}>\n ${u} ${n} ${d}` + (f ? ` <line x1="2" y1="${o}" x2="${(r.width - 2).toFixed(2)}" y2="${o}" style="stroke:#000;stroke-width:0.7"></line>\n` : "") + " </g>\n";
|
|
661
661
|
}
|
|
662
662
|
if (r.isSplitPart && (r.isEmpty || r.blankType) && a === "edit") {
|
|
663
663
|
let e = `<rect x="0" y="0" width="${r.width.toFixed(2)}" height="30" fill="rgb(245,245,245)" opacity="0.6"></rect>\n`;
|
|
664
|
-
return ` <g class="swed-underline" transform="translate(${t.toFixed(2)}, ${i})"${s}${c}${l}>\n ${u} ${e} <line x1="2" y1="${o}" x2="${(r.width - 2).toFixed(2)}" y2="${o}" style="stroke:#000;stroke-width:${r.lineWidth}"></line>\n </g>\n
|
|
664
|
+
return ` <g class="swed-underline" transform="translate(${t.toFixed(2)}, ${i})"${s}${c}${l}>\n ${u} ${e}` + (f ? ` <line x1="2" y1="${o}" x2="${(r.width - 2).toFixed(2)}" y2="${o}" style="stroke:#000;stroke-width:${r.lineWidth}"></line>\n` : "") + " </g>\n";
|
|
665
665
|
}
|
|
666
666
|
return ` <g class="swed-underline" transform="translate(${t.toFixed(2)}, ${i})"${s}${c}${l}>\n ${u} <line x1="2" y1="${o}" x2="${(r.width - 2).toFixed(2)}" y2="${o}" style="stroke:#000;stroke-width:${r.lineWidth}"></line>\n </g>\n`;
|
|
667
667
|
}
|