Handle NoWidget

Why did this get dom_node = Container(classes={'inspector_highlight'}, pseudo_classes={'enabled'})?
This commit is contained in:
Isaiah Odhner 2023-06-03 15:18:37 -04:00
parent 892d12e8fb
commit 377a883d3b

View File

@ -830,7 +830,10 @@ class Inspector(Container):
# show_box("region", dom_node.region, "blue")
# show_box("scrollable_content_region", dom_node.scrollable_content_region, "red")
map_geometry = self.screen.find_widget(dom_node)
try:
map_geometry = self.screen.find_widget(dom_node)
except NoWidget:
return
regions = subtract_regions(map_geometry.region, map_geometry.clip)
for index, region in enumerate(regions):
show_box(f"clipped:{index}", region, "aquamarine")