Skip to content

Commit

Permalink
Fix fuzzy select tool
Browse files Browse the repository at this point in the history
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!
  • Loading branch information
guillaumechereau committed Jul 1, 2024
1 parent 6ce4af5 commit 872f532
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions src/goxel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/tools/fuzzy_select.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 872f532

Please sign in to comment.