|
|
@@ -306,9 +306,7 @@ this.docHelper = this.docHelper || (() => {
|
|
|
function getSize(win, imageElement) {
|
|
|
let pxWidth = imageElement.naturalWidth;
|
|
|
let pxHeight = imageElement.naturalHeight;
|
|
|
- if (pxWidth > 0 && pxHeight > 0) {
|
|
|
- return { pxWidth, pxHeight };
|
|
|
- } else {
|
|
|
+ if (!pxWidth && !pxHeight) {
|
|
|
const computedStyle = win.getComputedStyle(imageElement);
|
|
|
let removeBorderWidth = false;
|
|
|
if (computedStyle.getPropertyValue("box-sizing") == "content-box") {
|
|
|
@@ -338,8 +336,8 @@ this.docHelper = this.docHelper || (() => {
|
|
|
}
|
|
|
pxWidth = Math.max(0, imageElement.clientWidth - paddingLeft - paddingRight - borderLeft - borderRight);
|
|
|
pxHeight = Math.max(0, imageElement.clientHeight - paddingTop - paddingBottom - borderTop - borderBottom);
|
|
|
- return { pxWidth, pxHeight };
|
|
|
}
|
|
|
+ return { pxWidth, pxHeight };
|
|
|
}
|
|
|
|
|
|
function getWidth(styleName, computedStyle) {
|