Explorar o código

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

Gildas %!s(int64=5) %!d(string=hai) anos
pai
achega
8cc713dfde
Modificáronse 1 ficheiros con 4 adicións e 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);
 						}