Update FontMetric

This commit is contained in:
kooriookami 2021-12-21 14:02:38 +08:00
parent 101c32ed71
commit 650d71e23b

View File

@ -47,7 +47,7 @@ export class FontMetrics {
span.appendChild(this._document.createTextNode(SAMPLE_TEXT));
container.appendChild(span);
container.appendChild(img);
const baseline = img.offsetTop - span.offsetTop + 2;
const baseline = img.offsetTop - span.offsetTop + 1;
container.removeChild(span);
container.appendChild(this._document.createTextNode(SAMPLE_TEXT));
@ -55,7 +55,7 @@ export class FontMetrics {
container.style.lineHeight = 'normal';
img.style.verticalAlign = 'super';
const middle = img.offsetTop - container.offsetTop + 2;
const middle = img.offsetTop - container.offsetTop + 1;
body.removeChild(container);