def move_viewport_to(self, addr: HexAddress, preserve_relative_offset: bool = False) -> None:
        """
        Translate the visible range so `addr` is visible.
        """
        assert self.start_addr <= addr < self.end_addr

        if preserve_relative_offset and (self.display_start_addr <= self.cursor < self.display_end_addr):
            # Let the target addr be on the same relative row from top of screen
            self.set_display_offset(addr - self.cursor + self.display_start_addr - self.start_addr)
            return

        if addr < self.display_start_addr:
            # Let the target addr be on the first displayed row
            self.set_display_offset(addr - self.start_addr)
            return

        # Let the target addr be on last fully displayed row
        max_fully_visible_bytes = 0x10 * (self.display_num_rows - 1)
        display_end = self.display_start_addr + max_fully_visible_bytes
        if addr >= display_end:
            offset = addr - max_fully_visible_bytes - self.start_addr + 0x10
            self.set_display_offset(offset)

        Translate the visible range so `addr` is visible.
        
angrmanagement/ui/views/hex_view.py