diff options
Diffstat (limited to 'src/gui/vectorinput.cpp')
| -rw-r--r-- | src/gui/vectorinput.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/vectorinput.cpp b/src/gui/vectorinput.cpp index 9ebb0fa..daed540 100644 --- a/src/gui/vectorinput.cpp +++ b/src/gui/vectorinput.cpp @@ -25,6 +25,16 @@ void gui_vectorinput_child_cb( void* ptr ) { GUI_FLOATINPUT* child = (GUI_FLOATINPUT*)ptr; // slider -> child view -> vectorinput GUI_VECTORINPUT* parent = (GUI_VECTORINPUT*)child->parent->parent; + for( auto& it : parent->lastchange ) + it = 0.f; + + for( U32 i = 0; i < parent->inputs.size; ++i ) { + if( parent->inputs.data[i] == child ) { + parent->lastchange.data[i] = child->lastchange; + break; + } + } + if( parent->cb ) parent->cb( parent ); } @@ -54,6 +64,7 @@ void __gui_internal_vectorinput_init( GUI_VIEW* parent = gui_get_view(); parent->children.push( input ); input->parent = parent; + input->lastchange.resize( valc ); gui_set_view( input ); @@ -77,6 +88,7 @@ void __gui_internal_vectorinput_init( printfmt ); + input->inputs.push( slider ); slider->cb = gui_vectorinput_child_cb; } |
