From 872f532fff4423a704160628f07dbcdf1c3d78b3 Mon Sep 17 00:00:00 2001 From: Guillaume Chereau Date: Mon, 1 Jul 2024 17:26:23 +0800 Subject: [PATCH] Fix fuzzy select tool Modified the behavior of the 3d gesture support so that we always update all the 3d cursors no matter what. The code is still a bit messy, need to find a better way! --- src/goxel.c | 2 -- src/tools/fuzzy_select.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/goxel.c b/src/goxel.c index 396718766..1bae4a6ba 100644 --- a/src/goxel.c +++ b/src/goxel.c @@ -694,7 +694,6 @@ static int on_drag(const gesture_t *gest, void *user) if (gest->state == GESTURE_END) c->flags &= ~CURSOR_PRESSED; - if (gest3d->type == GESTURE_HOVER) continue; c->snaped = goxel_unproject( gest->viewport, gest->pos, gest3d->snap_mask, gest3d->snap_shape, gest3d->snap_offset, @@ -814,7 +813,6 @@ static int on_hover(const gesture_t *gest, void *user) for (i = 0; i < goxel.gesture3ds_count; i++) { gest3d = &goxel.gesture3ds[i].gesture; - if (gest3d->type != GESTURE_HOVER) continue; c = &goxel.gesture3ds[i].cursor; c->snaped = goxel_unproject( gest->viewport, gest->pos, gest3d->snap_mask, diff --git a/src/tools/fuzzy_select.c b/src/tools/fuzzy_select.c index 1cef90f19..685dbf134 100644 --- a/src/tools/fuzzy_select.c +++ b/src/tools/fuzzy_select.c @@ -65,7 +65,7 @@ static int iter(tool_t *tool_, const painter_t *painter, tool_fuzzy_select_t *tool = (void*)tool_; goxel_gesture3d(&(gesture3d_t) { .type = GESTURE_CLICK, - .snap_mask = SNAP_VOLUME, + .snap_mask = SNAP_VOLUME | SNAP_IMAGE_BOX, .snap_offset = -0.5, .callback = on_click, .user = tool,