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

◆ on_resize()

void MayaFlux::Portal::Forma::Context::on_resize ( uint32_t  id,
ResizeFn  fn 
)

Called on every window resize.

Per-element like the other callbacks, so more than one bound id (e.g. several pixel-anchored TextFields on the same Context) can each react independently. Cleared by unbind(id) same as every other callback.

Hit-test-driven placement (to_ndc() at event time) already tracks resize for free; this is for callers anchored by a fixed pixel rect via to_ndc_rect(), which must be recomputed explicitly when the window's dimensions change.

Parameters
idElement id to bind to.
fnCallback receiving the new (width, height).

Definition at line 136 of file Context.cpp.

137{
138 m_callbacks[id].resize = std::move(fn);
139}
std::unordered_map< uint32_t, ElementCallbacks > m_callbacks
Definition Context.hpp:361

References m_callbacks.

Referenced by MayaFlux::Portal::Forma::make_entry(), and MayaFlux::Portal::Forma::Plot::place_label().

+ Here is the caller graph for this function: