(self, x0, y0, x1, y1)
return row0, col0, row1, col1
Convert from pixel area to text area.
Convert from pixel area to text area.
Convert from pixel area to text area .
def pixel_to_text_area(self, x0, y0, x1, y1):
        """Convert from pixel area to text area."""
        col0 = min(self._width, max(1, 1 + x0 // self._font.width))
        row0 = min(self._height, max(1, 1 + y0 // self._font.height))
        col1 = min(self._width, max(1, 1 + x1 // self._font.width))
        row1 = min(self._height, max(1, 1 + y1 // self._font.height))
        return row0, col0, row1, col1
def pixel_to_text_area ( self , x0 , y0 , x1 , y1 ) : col0 = min ( self . _width , max ( 1 , 1 + x0 // self . _font . width ) ) row0 = min ( self . _height , max ( 1 , 1 + y0 // self . _font . height ) ) col1 = min ( self . _width , max ( 1 , 1 + x1 // self . _font . width ) ) row1 = min ( self . _height , max ( 1 , 1 + y1 // self . _font . height ) ) return row0 , col0 , row1 , col1