Skip to content

Commit

Permalink
Avoid sending identity box move events
Browse files Browse the repository at this point in the history
This was making the move tool recompute the volume all the time instead
of only doing it when necessary.
  • Loading branch information
guillaumechereau committed Jul 5, 2024
1 parent 0220dd2 commit b7fa31e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/gizmos.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,12 @@ int box_edit(const float box[4][4], int mode, float transf[4][4])
render_box(&goxel.rend, box, NULL, EFFECT_STRIP | EFFECT_WIREFRAME);
if (transf) mat4_copy(g_data.transf, transf);

// Avoid sending an update event if we didn't actually move.
if ( (g_data.gesture_state == GESTURE3D_STATE_UPDATE) &&
mat4_is_identity(g_data.transf)) {
return 0;
}

return g_data.gesture_state;
}

Expand Down

0 comments on commit b7fa31e

Please sign in to comment.