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

◆ reposition()

void MayaFlux::Portal::Forma::TextField::reposition ( Kinesis::AABB2D  new_bounds)

Move the field to a new NDC region, keeping its content.

The visual half of a scroll reflow - lays the text out again and resubmits it with the caret together at the new region (see the class doc's note on why both are always resubmitted together), nothing else. Wire directly as a Scrollable::track() reposition callback (see the class doc example); Scrollable's own reflow() already pushes the matching bounds_hint to the Layer, so hit-testing stays correct without this needing a Layer of its own.

Parameters
new_boundsShifted NDC region.

Definition at line 277 of file TextField.cpp.

278{
279 field_bounds = new_bounds;
280 if (m_live_bounds)
281 *m_live_bounds = new_bounds;
282
283 if (slice && state && params) {
284 slice->set_bounds(new_bounds);
285 render_caret(*slice, state->value, *params);
286 }
287}
std::shared_ptr< MappedState< Portal::Text::EditableText > > state
Live editable text and cursor. Valid after place().
Definition TextField.hpp:97
std::shared_ptr< Portal::Text::PressParams > params
Shared, mutable render params - every re-render reads this fresh, so a caller can change it once and ...
std::shared_ptr< internal::TextSlice > slice
The text and caret drawn into buf. Valid after place().
std::shared_ptr< Kinesis::AABB2D > m_live_bounds
Same value as field_bounds, behind a shared_ptr so wire()'s already-captured Context closures see a r...
Kinesis::AABB2D field_bounds
NDC region occupied by the field. Valid after place().

References field_bounds, m_live_bounds, params, slice, and state.