Quellcode durchsuchen

fixed issue when an image has a width 1px xor a height of 1px

Gildas vor 7 Jahren
Ursprung
Commit
b86177ffea
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      lib/single-file/doc-helper.js

+ 1 - 1
lib/single-file/doc-helper.js

@@ -285,7 +285,7 @@ this.docHelper = this.docHelper || (() => {
 				const computedStyle = win.getComputedStyle(imageElement);
 				const computedStyle = win.getComputedStyle(imageElement);
 				if (computedStyle) {
 				if (computedStyle) {
 					imageData.size = getSize(win, imageElement);
 					imageData.size = getSize(win, imageElement);
-					if ((!computedStyle.getPropertyValue("background-image") || computedStyle.getPropertyValue("background-image") == "none") && imageData.size.pxWidth > 1 && imageData.size.pxHeight > 1) {
+					if ((!computedStyle.getPropertyValue("background-image") || computedStyle.getPropertyValue("background-image") == "none") && (imageData.size.pxWidth > 1 || imageData.size.pxHeight > 1)) {
 						imageData.replaceable = true;
 						imageData.replaceable = true;
 						imageData.backgroundColor = computedStyle.getPropertyValue("background-color");
 						imageData.backgroundColor = computedStyle.getPropertyValue("background-color");
 						imageData.objectFit = computedStyle.getPropertyValue("object-fit");
 						imageData.objectFit = computedStyle.getPropertyValue("object-fit");