Skip to content

Commit

Permalink
Fix bug with 'space' key on brush tool
Browse files Browse the repository at this point in the history
Since recent change in the way we handle the 3d gestures, we have to
make sure we update the snap offset from within the gesture handler.
  • Loading branch information
guillaumechereau committed Jul 9, 2024
1 parent d300bc2 commit 61a13da
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/tools/brush.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ static int on_hover(gesture3d_t *gest)
return 0;
}

// Update snap offset in case we press 'space'.
gest->snap_offset = goxel.snap_offset * goxel.tool_radius +
((painter->mode == MODE_OVER) ? 0.5 : -0.5);

if (shift)
render_line(&goxel.rend, brush->start_pos, gest->pos, NULL, 0);

Expand Down

0 comments on commit 61a13da

Please sign in to comment.