fix(expr): reflect pending TextStyle baseline edits in expression getters (#545)

This commit is contained in:
Nigel Ihza Firdausy
2026-10-10 15:50:18 +07:00
parent 813c7c4650
commit 6ed3d210fb
2 changed files with 37 additions and 2 deletions
+4 -2
View File
@@ -932,8 +932,10 @@ __TextStyle.prototype = {
setVerticalScaling: __styleSetter('vScale'),
setTsume: __styleSetter('tsume'),
setBaselineOption: __styleSetter('baseline', function (v) { return String(v).toLowerCase().replace('_baseline', ''); }),
setSuperscript: __styleSetter('superscript', Boolean),
setSubscript: __styleSetter('subscript', Boolean),
// Canonical baseline operations also make the returned TextStyle's getters reflect
// the pending edit, rather than waiting for the host to apply a superscript flag.
setSuperscript: __styleSetter('baseline', function (v) { return v ? 'superscript' : 'normal'; }),
setSubscript: __styleSetter('baseline', function (v) { return v ? 'subscript' : 'normal'; }),
setKerningType: __styleSetter('kerning', function (v) { v = String(v).toLowerCase(); return v === 'manual' ? 0 : v; }),
setKerning: __styleSetter('kerning', Number),
setLigature: __styleSetter('ligatures', Boolean),