From: Olaf Wintermann Date: Sat, 1 Feb 2025 20:52:54 +0000 (+0100) Subject: fix point2item detecting out of bounds columns X-Git-Url: https://uap-core.de/gitweb/?a=commitdiff_plain;h=6e5d4012564a2243070f4bf6350fd01d58a2dc8a;p=mizunara.git fix point2item detecting out of bounds columns --- diff --git a/mizunara/gtk-filesview.c b/mizunara/gtk-filesview.c index dfac4ea..a2e56b2 100644 --- a/mizunara/gtk-filesview.c +++ b/mizunara/gtk-filesview.c @@ -171,7 +171,7 @@ static int point2item(MzFilesView *view, int x, int y, int *out_col, int *out_ro row = -1; } - if(col >= 0 && row >= 0) { + if(col >= 0 && row >= 0 && col < items_per_line) { *out_col = col; *out_row = row; if(index) { @@ -501,7 +501,7 @@ static void drag_begin_cb( if(point2item(view, start_x, start_y, &col, &row, &item_index)) { if(view->numsections > 0 && item_index < cxListSize(view->sections[0].section.files)) { FileInfo *file = cxListAt(view->sections[0].section.files, item_index); - printf("drag file[%d]: %s\n", view->items[item_index].isselected, file->name); + printf("%d x %d drag file[%d]: %s\n", col, row, view->items[item_index].isselected, file->name); view->drag_file = file; view->drag_item = TRUE; if(view->items[item_index].isselected) {