Not user callable. Used to convert tkinter Canvas coords into user's coordinates :param x_in: The x coordinate in canvas coordinates :type x_in: (int) :param y_in: (int) The y coordinate in canvas coordinates :type y_in: :return: The converted
(self, x_in, y_in)
| 6242 | return new_x, new_y |
| 6243 | |
| 6244 | def _convert_canvas_xy_to_xy(self, x_in, y_in): |
| 6245 | """ |
| 6246 | Not user callable. Used to convert tkinter Canvas coords into user's coordinates |
| 6247 | |
| 6248 | :param x_in: The x coordinate in canvas coordinates |
| 6249 | :type x_in: (int) |
| 6250 | :param y_in: (int) The y coordinate in canvas coordinates |
| 6251 | :type y_in: |
| 6252 | :return: The converted USER coordinates |
| 6253 | :rtype: (int, int) | Tuple[float, float] |
| 6254 | """ |
| 6255 | if None in (x_in, y_in): |
| 6256 | return None, None |
| 6257 | scale_x = (self.CanvasSize[0] - 0) / (self.TopRight[0] - self.BottomLeft[0]) |
| 6258 | scale_y = (0 - self.CanvasSize[1]) / (self.TopRight[1] - self.BottomLeft[1]) |
| 6259 | |
| 6260 | new_x = x_in / scale_x + self.BottomLeft[0] |
| 6261 | new_y = (y_in - self.CanvasSize[1]) / scale_y + self.BottomLeft[1] |
| 6262 | if self.FloatValues: |
| 6263 | return new_x, new_y |
| 6264 | else: |
| 6265 | return floor(new_x), floor(new_y) |
| 6266 | |
| 6267 | def draw_line(self, point_from, point_to, color='black', width=1, arrow=None, arrow_shape=None): |
| 6268 | """ |
no outgoing calls
no test coverage detected