Fixing annoying UX bugs
Captain's Log: Stardate 77544.2
Today I've mostly been trying to systematically knock out small bugs. I did a bit of a refactoring to finish cleaning up the last of the logging stuff, but now that's all behind me and I'm just closing annoying bugs that have been bothering me for a while.
One bug I fixed had to do with ray/cylinder intersection code for the GUI, which is used in mouse-picking objects that have roughly cylindrical shape like mics, springs, etc. I noticed a couple weeks ago that the mouse-picking was janky in orthogonal views, despite working perfectly in perspective views. It turns out that this is because I changed the implementation a while back to make it more accurate... and I did improve the accuracy for perspective views, but failed to test orthogonal ones. The issue was a floating point precision problem, because for orthogonal views, I fabricate a camera origin that's "really far" from the zero origin along the orthogonal axis. (I do this because I have ray/cylinder intersection code, not line/cylinder.) Anyway, the simplest solution for now was to just use doubles for the intermediate calculations. Maybe one day I'll come back and write a line/cylinder intersection.
The other bug I started working on has to do with undo/redo and mouse wheel events on sliders. Right now it's really annoying, because each click of the mouse wheel generates and undo event. So if you scroll the mouse wheel a lot, you end up with a zillion tiny little undo events. (Initially I thought undo was just broken for mouse wheel, because pressing undo didn't do much of anything.)
The fix for this is obvious, but is a pain in the butt to implement well. It's just to time-batch things so that as long as you keep moving the mouse wheel without a long pause, only a single undo event will be generated. Once you pause for, say, a second or two, it resets. I have this sort-of working but tomorrow I need to resolve all the edge cases.