(e)
| 88 | |
| 89 | |
| 90 | def move_text(e): |
| 91 | global text_label, new_x, new_y |
| 92 | canvas_width = image_canvas.winfo_width() |
| 93 | canvas_height = image_canvas.winfo_height() |
| 94 | label_width = image_canvas.bbox(text_label)[2] - image_canvas.bbox(text_label)[0] |
| 95 | label_height = image_canvas.bbox(text_label)[3] - image_canvas.bbox(text_label)[1] |
| 96 | |
| 97 | new_x = e.x |
| 98 | new_y = e.y |
| 99 | |
| 100 | if new_x < 0: |
| 101 | new_x = 0 |
| 102 | elif new_x + label_width > canvas_width: |
| 103 | new_x = canvas_width - label_width |
| 104 | |
| 105 | if new_y < 0: |
| 106 | new_y = 0 |
| 107 | elif new_y + label_height > canvas_height: |
| 108 | new_y = canvas_height - label_height |
| 109 | image_canvas.coords(text_label, new_x, new_y) |
| 110 | |
| 111 | |
| 112 | def choose_color(): |
nothing calls this directly
no outgoing calls
no test coverage detected