MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ wire_drag()

Context & MayaFlux::Portal::Forma::Context::wire_drag ( uint32_t  id,
std::function< void(glm::vec2)>  sink,
IO::MouseButtons  btn = IO::MouseButtons::Left 
)

Register a drag handler receiving only the cursor position.

Thin composition over on_drag for callers that already know the element id and have no use for it in the callback. The sink performs whatever mapping and write the gesture implies.

Parameters
idElement id.
sinkCalled with the current NDC cursor position on each drag event.
btnMouse button that must be held.
Returns
*this for chaining.

Definition at line 173 of file Context.cpp.

177{
178 if (!sink)
179 return *this;
180
181 on_drag(id, btn,
182 [sink = std::move(sink)](uint32_t, glm::vec2 ndc) { sink(ndc); });
183
184 return *this;
185}
void on_drag(uint32_t id, IO::MouseButtons btn, MoveFn fn)
Called on each mouse-move event while btn is held, tracking the element where the drag began even whe...
Definition Context.cpp:48

References on_drag().

Referenced by MayaFlux::Portal::Forma::Geometry::wire_drag().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: