mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
fix: strike-through line positions correctly
This commit is contained in:
parent
6020386bbe
commit
3650f0da77
@ -37,25 +37,24 @@ export class FontMetrics {
|
|||||||
|
|
||||||
img.style.margin = '0';
|
img.style.margin = '0';
|
||||||
img.style.padding = '0';
|
img.style.padding = '0';
|
||||||
|
img.style.display = 'inline';
|
||||||
img.style.verticalAlign = 'baseline';
|
img.style.verticalAlign = 'baseline';
|
||||||
|
|
||||||
span.style.fontFamily = fontFamily;
|
span.style.fontFamily = fontFamily;
|
||||||
span.style.fontSize = fontSize;
|
span.style.fontSize = fontSize;
|
||||||
span.style.margin = '0';
|
span.style.margin = '0';
|
||||||
span.style.padding = '0';
|
span.style.padding = '0';
|
||||||
|
span.style.display = 'inline';
|
||||||
|
|
||||||
span.appendChild(this._document.createTextNode(SAMPLE_TEXT));
|
span.appendChild(this._document.createTextNode(SAMPLE_TEXT));
|
||||||
container.appendChild(span);
|
container.appendChild(span);
|
||||||
container.appendChild(img);
|
container.appendChild(img);
|
||||||
const baseline = img.offsetTop - span.offsetTop + 2;
|
const baseline = img.offsetTop - span.offsetTop + 2;
|
||||||
|
|
||||||
container.removeChild(span);
|
|
||||||
container.appendChild(this._document.createTextNode(SAMPLE_TEXT));
|
|
||||||
|
|
||||||
container.style.lineHeight = 'normal';
|
container.style.lineHeight = 'normal';
|
||||||
img.style.verticalAlign = 'super';
|
img.style.verticalAlign = 'super';
|
||||||
|
|
||||||
const middle = img.offsetTop - container.offsetTop + 2;
|
const middle = img.offsetTop - span.offsetTop + 2;
|
||||||
|
|
||||||
body.removeChild(container);
|
body.removeChild(container);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user