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

◆ bind_scroll()

void MayaFlux::Portal::Forma::LayoutCursor::bind_scroll ( std::shared_ptr< MappedState< glm::vec2 > >  offset)
inline

Bind a live scroll offset.

advance() folds its current value into every bounds it returns from this point on.

The offset itself is Kinesis::ScrollState's concern (content bounds, clamping, wheel/drag input); this only consumes the resulting value. Binding does not retroactively shift bounds already handed out by earlier advance() calls - those were snapshots, same as advance() has always returned. A geometry function that needs those existing placements to reflow live as the user scrolls (not just new ones placed after a scroll already happened) should close over scroll_offset() itself and add it to its own captured bounds inside the GeometryFn body, the same reflow-via-shared-state idiom every other Mapped<T> primitive already uses for its own value.

Parameters
offsetShared scroll offset, written elsewhere (typically from Kinesis::apply_scroll/apply_wheel_scroll via an on_scroll callback).

Definition at line 76 of file LayoutCursor.hpp.

77 {
78 m_scroll_offset = std::move(offset);
79 }
uint64_t offset
Definition Composite.cpp:10
std::shared_ptr< MappedState< glm::vec2 > > m_scroll_offset

References m_scroll_offset, and offset.

Referenced by MayaFlux::Portal::Forma::Scrollable::place().

+ Here is the caller graph for this function: