(self, fx, fy, step=False)
return x, y
Convert logical to physical coordinates.
Convert logical to physical coordinates.
Convert logical to physical coordinates .
def _get_window_physical(self, fx, fy, step=False):
        """Convert logical to physical coordinates."""
        if self._window:
            scalex, scaley, offsetx, offsety = self._window
            if step:
                fx0, fy0 = self._get_window_logical(*self._last_point)
            else:
                fx0, fy0 = 0., 0.
            x = int(round(offsetx + (fx0+fx) * scalex))
            y = int(round(offsety + (fy0+fy) * scaley))
        else:
            x, y = self._last_point if step else (0, 0)
            x += int(round(fx))
            y += int(round(fy))
        # overflow check
        if x < -0x8000 or y < -0x8000 or x > 0x7fff or y > 0x7fff:
            raise error.BASICError(error.OVERFLOW)
        return x, y
def _get_window_physical ( self , fx , fy , step = False ) : if self . _window : scalex , scaley , offsetx , offsety = self . _window if step : fx0 , fy0 = self . _get_window_logical ( * self . _last_point ) else : fx0 , fy0 = 0. , 0. x = int ( round ( offsetx + ( fx0 + fx ) * scalex ) ) y = int ( round ( offsety + ( fy0 + fy ) * scaley ) ) else : x , y = self . _last_point if step else ( 0 , 0 ) x += int ( round ( fx ) ) y += int ( round ( fy ) ) # overflow check if x < - 0x8000 or y < - 0x8000 or x > 0x7fff or y > 0x7fff : raise error . BASICError ( error . OVERFLOW ) return x , y