diff options
| author | aura <nw@moneybot.cc> | 2026-03-17 12:04:30 +0100 |
|---|---|---|
| committer | aura <nw@moneybot.cc> | 2026-03-17 12:04:30 +0100 |
| commit | a156bc15880e9e250c9c40f0dde431e077109dc1 (patch) | |
| tree | 64b6461b0d0e9cad6ff7fdcfba563e103fad9067 /src/gui/vectorinput.cpp | |
| parent | 991352b0d2767e6bd1a46f554db4ac9d208c13ad (diff) | |
multi select
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; } |
