def select_by_rect(self, start, end, flag=False): start = self.win_to_doc(start) end = self.win_to_doc(end) rect = start + end rect = normalize_bbox(rect) self.presenter.selection.select_by_rect(rect, flag)
def bbox_doc_to_win(self, bbox): new_bbox = self.doc_to_win(bbox[:2]) + self.doc_to_win(bbox[2:]) return normalize_bbox(new_bbox)
def bbox_win_to_doc(self, bbox): new_bbox = self.win_to_doc(bbox[:2]) + self.win_to_doc(bbox[2:]) return normalize_bbox(new_bbox)