From 0bb9bfb9bcbaa8652637363c7e012ca17c7d4344 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 7 Apr 2015 02:11:06 +0000 Subject: [PATCH] MUIM_List_TestPos now treats the last column as extending to the right-hand edge of the list. Previously, a click in any extra horizontal space between the end of the last column and the end of the list resulted in a report of column N for an N-column list. git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@50293 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- workbench/libs/muimaster/classes/list.c | 18 ++++++++++-------- workbench/libs/muimaster/muimaster.conf | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/workbench/libs/muimaster/classes/list.c b/workbench/libs/muimaster/classes/list.c index 2aea2349ab..76ea0e0550 100644 --- a/workbench/libs/muimaster/classes/list.c +++ b/workbench/libs/muimaster/classes/list.c @@ -1,5 +1,5 @@ /* - Copyright © 2002-2014, The AROS Development Team. All rights reserved. + Copyright © 2002-2015, The AROS Development Team. All rights reserved. $Id$ */ @@ -2664,7 +2664,7 @@ IPTR List__MUIM_TestPos(struct IClass *cl, Object *obj, struct MUI_ListData *data = INST_DATA(cl, obj); struct MUI_List_TestPos_Result *result = msg->res; LONG col = -1, row = -1; - UWORD flags = 0; + UWORD flags = 0, i; LONG mx = msg->x - _left(obj); LONG entries_visible; @@ -2698,18 +2698,20 @@ IPTR List__MUIM_TestPos(struct IClass *cl, Object *obj, if (data->entries_num > 0 && data->columns > 0) { LONG width_sum = 0; - for (col = 0; col < data->columns; col++) + col = data->columns - 1; + for (i = 0; i < data->columns; i++) { result->xoffset = mx - width_sum; width_sum += - data->ci[col].entries_width + - data->ci[col].delta + - (data->ci[col].bar ? BAR_WIDTH : 0); - D(bug("[List/MUIM_TestPos] col %d " + data->ci[i].entries_width + + data->ci[i].delta + + (data->ci[i].bar ? BAR_WIDTH : 0); + D(bug("[List/MUIM_TestPos] i %d " "width %d width_sum %d mx %d\n", - col, data->ci[col].entries_width, width_sum, mx)); + i, data->ci[i].entries_width, width_sum, mx)); if (mx < width_sum) { + col = i; D(bug("[List/MUIM_TestPos] Column hit %d\n", col)); break; } diff --git a/workbench/libs/muimaster/muimaster.conf b/workbench/libs/muimaster/muimaster.conf index 8913fef286..eae121098f 100644 --- a/workbench/libs/muimaster/muimaster.conf +++ b/workbench/libs/muimaster/muimaster.conf @@ -2,7 +2,7 @@ basename MUIMaster libbase MUIMasterBase libbasetype struct MUIMasterBase_intern -version 19.48 +version 19.49 ##end config ##begin cdef -- 2.11.4.GIT