|
MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
|
| MAYAFLUX_API void MayaFlux::Portal::Forma::Geometry::wire_canvas_drag | ( | Context & | ctx, |
| uint32_t | id, | ||
| std::shared_ptr< MappedState< std::vector< float > > > | state, | ||
| Kinesis::AABB2D | bounds | ||
| ) |
Wire drag interaction for a drawable canvas element.
Registers a left-button drag callback on ctx that maps NDC cursor position to a sample index and amplitude, writes into state, and increments the version. Linear interpolation fills the range between the previously touched index and the current one, preventing sparse samples under fast drag.
| ctx | Context owning the element. |
| id | Element id from the Mapped. |
| state | MappedState<vector<float>> to write into. |
| bounds | Canvas NDC bounds — must match those passed to drawable_canvas(). |
Definition at line 334 of file Geometry.cpp.
References a, MayaFlux::Kinesis::AABB2D::height(), MayaFlux::IO::Left, MayaFlux::Kinesis::AABB2D::min, MayaFlux::Portal::Forma::Context::on_drag(), MayaFlux::Portal::Forma::Context::on_release(), and MayaFlux::Kinesis::AABB2D::width().
Here is the call graph for this function: