|
|
@@ -333,17 +333,10 @@ this.docHelper = this.docHelper || (() => {
|
|
|
} else {
|
|
|
borderLeft = borderRight = borderTop = borderBottom = 0;
|
|
|
}
|
|
|
- const width = imageElement.clientWidth;
|
|
|
- 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) {
|
|
|
- return {
|
|
|
- width: (paddingLeft || paddingRight || borderLeft || borderRight) && (width - paddingLeft - paddingRight - borderLeft - borderRight) + "px",
|
|
|
- pxWidth: pxWidth,
|
|
|
- height: (paddingTop || paddingBottom || borderTop || borderBottom) && (height - paddingTop - paddingBottom - borderTop - borderBottom) + "px",
|
|
|
- pxHeight: pxHeight,
|
|
|
- };
|
|
|
+ const pxWidth = imageElement.naturalWidth || (imageElement.clientWidth - paddingLeft - paddingRight - borderLeft - borderRight);
|
|
|
+ const pxHeight = imageElement.naturalHeight || (imageElement.clientHeight - paddingTop - paddingBottom - borderTop - borderBottom);
|
|
|
+ if (pxWidth >= 0 && pxHeight >= 0 && paddingLeft >= 0 && paddingRight >= 0 && paddingTop >= 0 && paddingBottom >= 0 && borderLeft >= 0 && borderRight >= 0 && borderTop >= 0 && borderBottom >= 0) {
|
|
|
+ return { pxWidth, pxHeight };
|
|
|
}
|
|
|
}
|
|
|
|