diff options
| author | aura <nw@moneybot.cc> | 2026-03-17 12:04:30 +0100 |
|---|---|---|
| committer | day <day@national.shitposting.agency> | 2026-03-20 22:52:49 +0100 |
| commit | 34d410da50e76f12c3d011293f4b544330e8ba3e (patch) | |
| tree | c8335b5699dc40e5de6233891a3cbe154612a224 /src/gui/vectorinput.cpp | |
| parent | 7cc07134a9759ed196b0fe5ea26c18d76e232952 (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; } |
