MCPcopy Index your code
hub / github.com/SLiCAP/SLiCAP_python / start_drawing

Method start_drawing

SLiCAP/schematic/canvas.py:810–822  ·  view source on GitHub ↗

Enter drawing mode for the given shape kind.

(self, kind: str)

Source from the content-addressed store, hash-verified

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():

Callers 2

_commit_shapeMethod · 0.95
_build_draw_menuMethod · 0.80

Calls 3

_end_wireMethod · 0.95
_cancel_placementMethod · 0.95
_cancel_drawMethod · 0.95

Tested by

no test coverage detected