fix(script): keep pending TextDocument baseline reads in sync (#549)

This commit is contained in:
Nigel Ihza Firdausy
2026-10-10 15:49:32 +07:00
parent 813c7c4650
commit 4f6256c486
2 changed files with 49 additions and 2 deletions
+9 -2
View File
@@ -480,9 +480,16 @@ TextDocument.prototype = {
get smallCaps() { return this.__style("smallCaps", false); },
set smallCaps(v) { this.__set("smallCaps", !!v); },
get superscript() { return this.__style("baseline", "normal") === "superscript"; },
set superscript(v) { this.__set("superscript", !!v); },
set superscript(v) {
// The pending document reads the same canonical baseline that setValue will apply.
if (v) this.__set("baseline", "superscript");
else if (this.superscript) this.__set("baseline", "normal");
},
get subscript() { return this.__style("baseline", "normal") === "subscript"; },
set subscript(v) { this.__set("subscript", !!v); },
set subscript(v) {
if (v) this.__set("baseline", "subscript");
else if (this.subscript) this.__set("baseline", "normal");
},
get tsume() { return this.__style("tsume", 0); },
set tsume(v) { this.__set("tsume", __num(v)); },
get boxText() { return !!(this.__base && this.__base.box_size); },