Enter drawing mode for the given shape kind.
(self, kind: str)
| 808 | # ── shape drawing ───────────────────────────────────────────────────────── |
| 809 | |
| 810 | def start_drawing(self, kind: str) -> None: |
| 811 | """Enter drawing mode for the given shape kind.""" |
| 812 | self._end_wire(commit=False) |
| 813 | self._cancel_placement() |
| 814 | self._cancel_draw() |
| 815 | self._draw_kind = kind |
| 816 | mode_map = { |
| 817 | "line": _Mode.DRAWING_LINE, |
| 818 | "rect": _Mode.DRAWING_RECT, |
| 819 | "circle": _Mode.DRAWING_CIRCLE, |
| 820 | } |
| 821 | self._mode = mode_map[kind] |
| 822 | self.placing_started.emit() # reuse signal: switches view to NoDrag |
| 823 | |
| 824 | def _cancel_draw(self) -> None: |
| 825 | if self._draw_ghost is not None and self._draw_ghost.scene(): |
no test coverage detected