Sfoglia il codice sorgente

removed obsolete code

Gildas 7 anni fa
parent
commit
6bd6947834
1 ha cambiato i file con 4 aggiunte e 11 eliminazioni
  1. 4 11
      lib/single-file/util/doc-helper.js

+ 4 - 11
lib/single-file/util/doc-helper.js

@@ -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 };
 		}
 	}