donotturnoff / aerend

My third year project
0 stars 0 forks source link

Improve determination of targeted widget #119

Closed donotturnoff closed 2 years ago

donotturnoff commented 2 years ago

The WidgetMap method for finding the correct widget to pass an event to is fast to use but slow to update and uses a lot of memory. It should be replaced with a quadtree, R-tree or some other spatial database/index.

donotturnoff commented 2 years ago

I used a custom algorithm which takes advantage of the layout managers' prior knowledge of where widgets would be placed to speed up bounds detection. It also uses the path of recursive calls to return the whole list of widgets from window to targeted widget, rather than working out this list later on. Implemented in a963d90b5cdc1ad209b6213da9f403de2cc84dc1