Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions de_shell/plotting/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,10 +512,10 @@ def add_circle_widget(self, *, cx: float, cy: float, r: float,
linewidth: float = 2, show_handles: bool = True):
"""A draggable circle overlay. Returns the widget, or None.

WIDGETS, not raw pointer handlers, are the working way to get user
geometry out of an anyplotlib figure: the plot owns the hit-testing and
pushes the new state back, whereas a bare `pointer_down` never arrives
(the plot's own pan consumes it).
WIDGETS are the way to get DRAGGED geometry out of an anyplotlib
figure: the plot owns the hit-testing and pushes the new state back.
A plain click does arrive as `pointer_down` (anyplotlib >= 0.7.3
separates a click from a pan), so use `on_event` for click-to-mark.

`on_change(cx, cy, r)` fires on ``pointer_up`` — when the drag settles —
not on every frame, so a callback that recomputes something expensive
Expand Down Expand Up @@ -567,9 +567,9 @@ def add_line_widget(self, *, x1: float, y1: float, x2: float, y2: float,

The measuring counterpart to the circle: drag either end onto a feature
and the length between them is the measurement. A LINE widget rather
than two clicks because the same argument applies — the plot owns the
hit-testing and pushes the geometry back, whereas a bare `pointer_down`
never arrives (the plot's own pan consumes it).
than two clicks because the plot owns the hit-testing of a drag and
pushes the geometry back; clicks themselves do arrive as
`pointer_down` on anyplotlib >= 0.7.3.

`on_change(x1, y1, x2, y2)` fires when a drag settles.
"""
Expand Down
Loading