hello
let's say i have a table with columns, each are subdivided into 4 subcolumns.
i can get which subcolumn (the 1st, the 2nd, the 3rd...) is hovered by the mouse by doing :
int subcol = ((int)mouse.x / SUBCOL_WIDTH * SUBCOL_WIDTH ) % 4
however, if i have, let's say, the 4th column bigger than the 3 others. How do i modify this line of code to handle that ?
Of course i could do it with conditions, four IFs checking the mouse position. But i'm looking for an elegant solution. Any ideas ?