ogl_beamforming

Ultrasound Beamforming Implemented with OpenGL
git clone anongit@rnpnr.xyz:ogl_beamforming.git
Log | Files | Refs | Feed | Submodules | README | LICENSE

Commit: 066308b568ecd2b2bd55e084ee48f6192c4d5eb8
Parent: e46dd7b22bebaef13778c6d1bc27e3a3ae4f34fe
Author: Randy Palamar
Date:   Sat,  5 Jul 2025 15:30:54 -0600

ui: make scroll on X-Plane modify threshold

Diffstat:
Mui.c | 14+++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/ui.c b/ui.c @@ -1,7 +1,6 @@ /* See LICENSE for license details. */ /* TODO(rnp): * [ ]: add V_HIDES_CURSOR for disabling/restoring cursor after drag - * [ ]: scroll on 3D X-Plane should be same as scroll on normal view * [ ]: live parameters control panel * [ ]: bug: clear color should not be transparent for a frame copy * [ ]: refactor: render_2d.frag should be merged into render_3d.frag @@ -3216,14 +3215,19 @@ ui_begin_interact(BeamformerUI *ui, BeamformerInput *input, b32 scroll) else hot->kind = InteractionKind_Nop; }break; case VT_X_PLANE_SHIFT:{ + assert(hot->var->parent && hot->var->parent->type == VT_BEAMFORMER_FRAME_VIEW); + BeamformerFrameView *bv = hot->var->parent->generic; if (IsMouseButtonDown(MOUSE_BUTTON_LEFT)) { - assert(hot->var->parent && hot->var->parent->type == VT_BEAMFORMER_FRAME_VIEW); - BeamformerFrameView *bv = hot->var->parent->generic; - XPlaneShift *xp = &hot->var->x_plane_shift; + XPlaneShift *xp = &hot->var->x_plane_shift; xp->start_point = xp->end_point = bv->hit_test_point; hot->kind = InteractionKind_Drag; } else { - hot->kind = InteractionKind_Nop; + if (scroll) { + hot->kind = InteractionKind_Scroll; + hot->var = &bv->threshold; + } else { + hot->kind = InteractionKind_Nop; + } } }break; case VT_BEAMFORMER_FRAME_VIEW:{