def _layout_regions(self) -> None:
        """
        Calculate displayed memory region positions and sizes.
        """
        self._addr_to_region.clear()
        self._position_to_region.clear()
        self._region_to_position.clear()
        self._region_to_width.clear()

        if self.instance.cfb.am_none:
            return

        # Add regions from largest to smallest
        for new_mr in sorted(self.instance.cfb.regions, key=lambda mr: mr.size, reverse=True):
            mr = self._find_first_overlapping_region(new_mr)
            if mr is not None:
                log.debug("Skipping CFB region %s, which overlaps %s", new_mr, mr)
                continue
            self._addr_to_region[new_mr.addr] = new_mr

        # Determine total displayed byte count
        rem_bytes = 0
        region_to_size = {}
        for mr in self._addr_to_region.values():
            size = mr.size if self._should_show_region_to_scale(mr) else 80
            region_to_size[mr] = size
            rem_bytes += size

        # Determine region widths in scene units
        rem_width = self.width
        for mr in self._addr_to_region.values():
            width = max(round(region_to_size[mr] * rem_width / rem_bytes), 1)
            self._region_to_width[mr] = width
            rem_bytes -= region_to_size[mr]
            rem_width -= width

        # Determine region position in scene units
        position = 0
        for mr in self._addr_to_region.values():
            self._region_to_position[mr] = position
            self._position_to_region[position] = mr
            position += self._region_to_width[mr]

        Calculate displayed memory region positions and sizes.
        
angrmanagement/ui/widgets/qfeature_map.py