Explorar el Código

remove only elements that don't overlap with the selected one

Gildas hace 5 años
padre
commit
8cc713dfde
Se han modificado 1 ficheros con 4 adiciones y 4 borrados
  1. 4 4
      extension/ui/content/content-ui-editor-web.js

+ 4 - 4
extension/ui/content/content-ui-editor-web.js

@@ -1322,10 +1322,10 @@ table {
 					elementKept.querySelectorAll(searchSelector).forEach(descendant => {
 						const descendantRect = descendant.getBoundingClientRect();
 						if (descendantRect.width && descendantRect.height && (
-							descendantRect.left < elementKeptRect.left ||
-							descendantRect.right > elementKeptRect.right ||
-							descendantRect.top < elementKeptRect.top ||
-							descendantRect.bottom > elementKeptRect.bottom
+							descendantRect.left + descendantRect.width < elementKeptRect.left ||
+							descendantRect.right > elementKeptRect.right + elementKeptRect.width ||
+							descendantRect.top + descendantRect.height < elementKeptRect.top ||
+							descendantRect.bottom > elementKeptRect.bottom + elementKeptRect.height
 						)) {
 							elements.push(descendant);
 						}