Been distracted fixing a scrolling bug in the menu library (libmenu). When I did the code I only really tested the code in "row major" mode where the menu items are laid out left to right in the desired number of columns, the other mode "column major" for want of a better term lays the menu items out going down the columns - in both cases the number of rows in a menu is determined by the number of items to display. You are supposed to be able to navigate around the menu items by using up/down/left/right commands (there are a lot of other commands too...). To make the navigation easier I pre-calculated the neighbours when the menu is being created and stored them in the item structure. Lots of edge cases, literally, doubly so because you can either have "cyclic" navigation which will wrap around the edges of the menu or "non-cyclic" where navigation stops at the edge of the menu. I had to totally rewrite the neighbour calculation and tidy up the menu drawing. Now it works as it should in both modes.
I have also played around with getting rescanning of the usb bus working. I am not sure if I am happy with what I have, you can rescan an attached device and it will be detached and reattached, you can rescan an entire bus but I am not sure if that does anything. More testing is required.
No comments:
Post a Comment