Not user callable. Used to convert user's coordinates into the ones used by tkinter :param x_in: The x coordinate to convert :type x_in: int | float :param y_in: The y coordinate to convert :type y_in: int | float :return: (int, int) The conver
(self, x_in, y_in)
| 6220 | return |
| 6221 | |
| 6222 | def _convert_xy_to_canvas_xy(self, x_in, y_in): |
| 6223 | """ |
| 6224 | Not user callable. Used to convert user's coordinates into the ones used by tkinter |
| 6225 | :param x_in: The x coordinate to convert |
| 6226 | :type x_in: int | float |
| 6227 | :param y_in: The y coordinate to convert |
| 6228 | :type y_in: int | float |
| 6229 | :return: (int, int) The converted canvas coordinates |
| 6230 | :rtype: (int, int) |
| 6231 | """ |
| 6232 | if None in (x_in, y_in): |
| 6233 | return None, None |
| 6234 | try: |
| 6235 | scale_x = (self.CanvasSize[0] - 0) / (self.TopRight[0] - self.BottomLeft[0]) |
| 6236 | scale_y = (0 - self.CanvasSize[1]) / (self.TopRight[1] - self.BottomLeft[1]) |
| 6237 | except: |
| 6238 | scale_x = scale_y = 0 |
| 6239 | |
| 6240 | new_x = 0 + scale_x * (x_in - self.BottomLeft[0]) |
| 6241 | new_y = self.CanvasSize[1] + scale_y * (y_in - self.BottomLeft[1]) |
| 6242 | return new_x, new_y |
| 6243 | |
| 6244 | def _convert_canvas_xy_to_xy(self, x_in, y_in): |
| 6245 | """ |
no outgoing calls
no test coverage detected