Explorar o código

prevent replacing images with a box shadow

Gildas %!s(int64=7) %!d(string=hai) anos
pai
achega
4468030133
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      lib/single-file/doc-helper.js

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

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