From b7fa31e822dba367c945af874ba9cffc9eb18450 Mon Sep 17 00:00:00 2001 From: Guillaume Chereau Date: Fri, 5 Jul 2024 15:46:04 +0800 Subject: [PATCH] Avoid sending identity box move events This was making the move tool recompute the volume all the time instead of only doing it when necessary. --- src/gizmos.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gizmos.c b/src/gizmos.c index 686991531..f9dbf78e6 100644 --- a/src/gizmos.c +++ b/src/gizmos.c @@ -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; }