Skip to content

Commit

Permalink
Fix box edit gizmo outside of image
Browse files Browse the repository at this point in the history
For the moment I do it using a little hack.  I think if the gesture code
was better as soon as a drag gesture is one it should disable all the
other gestures.
  • Loading branch information
guillaumechereau committed Jul 4, 2024
1 parent 1a1bcd9 commit 45c9065
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/box_edit.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,3 +278,8 @@ int box_edit(const float box[4][4], int mode, float transf[4][4])

return g_data.gesture_state;
}

bool box_edit_is_active(void)
{
return g_data.gesture_state;
}
1 change: 1 addition & 0 deletions src/goxel.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,7 @@ static int on_drag_rotate(const gesture_t *gest, void *user)
float pos[3], normal[3];
bool snap;
if (gest->state == GESTURE_BEGIN) {
if (box_edit_is_active()) return 1; // XXX: to remve.
snap = goxel_unproject(
gest->viewport, gest->pos,
SNAP_IMAGE_BOX | SNAP_SELECTION_OUT | SNAP_VOLUME,
Expand Down
2 changes: 2 additions & 0 deletions src/goxel.h
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,8 @@ int gox_iter_infos(const char *path,
*/
int box_edit(const float box[4][4], int mode, float transf[4][4]);

bool box_edit_is_active(void);


void settings_load(void);
void settings_save(void);
Expand Down

0 comments on commit 45c9065

Please sign in to comment.