|
@@ -335,12 +335,14 @@ this.docHelper = this.docHelper || (() => {
|
|
|
}
|
|
}
|
|
|
const width = imageElement.clientWidth;
|
|
const width = imageElement.clientWidth;
|
|
|
const height = imageElement.clientHeight;
|
|
const height = imageElement.clientHeight;
|
|
|
|
|
+ const pxWidth = imageElement.naturalWidth || (width - paddingLeft - paddingRight - borderLeft - borderRight);
|
|
|
|
|
+ const pxHeight = imageElement.naturalHeight || (height - paddingTop - paddingBottom - borderTop - borderBottom);
|
|
|
if (width >= 0 && height >= 0 && paddingLeft >= 0 && paddingRight >= 0 && paddingTop >= 0 && paddingBottom >= 0 && borderLeft >= 0 && borderRight >= 0 && borderTop >= 0 && borderBottom >= 0) {
|
|
if (width >= 0 && height >= 0 && paddingLeft >= 0 && paddingRight >= 0 && paddingTop >= 0 && paddingBottom >= 0 && borderLeft >= 0 && borderRight >= 0 && borderTop >= 0 && borderBottom >= 0) {
|
|
|
return {
|
|
return {
|
|
|
width: (paddingLeft || paddingRight || borderLeft || borderRight) && (width - paddingLeft - paddingRight - borderLeft - borderRight) + "px",
|
|
width: (paddingLeft || paddingRight || borderLeft || borderRight) && (width - paddingLeft - paddingRight - borderLeft - borderRight) + "px",
|
|
|
- pxWidth: width - paddingLeft - paddingRight - borderLeft - borderRight,
|
|
|
|
|
|
|
+ pxWidth: pxWidth,
|
|
|
height: (paddingTop || paddingBottom || borderTop || borderBottom) && (height - paddingTop - paddingBottom - borderTop - borderBottom) + "px",
|
|
height: (paddingTop || paddingBottom || borderTop || borderBottom) && (height - paddingTop - paddingBottom - borderTop - borderBottom) + "px",
|
|
|
- pxHeight: height - paddingTop - paddingBottom - borderTop - borderBottom,
|
|
|
|
|
|
|
+ pxHeight: pxHeight,
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|