Touch interfaces and approximate position spanning different widgets/areas
(copy from https://gist.github.com/vurtun/61b6dbf21ef060bcbbd8d1faa88350d9#gistcomment-2268492 )
I stumbled upon the following special requirement on handling of a "cursor" on touch devices. Namely, that the position of the touch is just approximate and should automatically be "attracted" by all buttons/sliders/whatever based on the Euclidean metric and a previously defined priority of each button/slider/whatever.
The issue is, that this (a click somewhere between buttons/sliders/whatever, but not directly on them) requires 3 costly steps basically in each frame:
- evaluation of precise positions of all buttons/sliders/whatever
- evaluation of the metric and priority rules - the result is a set of buttons/sliders/whatever which are affected by the cursor position
- reaction of the affected buttons/sliders/whatever on the cursor position as well as chained reaction of other parts of the GUI to the changes
My understanding is, that step 1. and 3. are very similar or the same and thus a double-work. Would you also have fear, that it's too slow? There is also this "react first in the second frame" solution. But I wanted a same-frame solution. Any ideas?
@dumblob Thanks for the link. I'll watch it later. Just had a quick overview.