Skip to content

Always update hover_fact

Dirk HOFFMANN requested to merge github/fork/ederag/IndexError into master

Created by: ederag

Solves #431 (closed). That seems to work fine, but is not entirely satisfying. Calling on_mouse_move from on_mouse_down simulates a mouse move before clicking. It feels a bit like a hack, but it was not easy to bring the common code to another function, because of the current structure.

As a note for future development (certainly not just before v3.0 !), since Facttree is a painter only (more details added to inline comments), we could get rid of self.hover_day and self.hover_fact, and use a property self.hover_index that would give the index of the hovered fact into the self.facts list. That property would use a new self._mouse_y that would be updated in on_mouse_move, or on_mouse_down. All on_mouse_move would do is updating self._mouse_y.

Another IndexError is fixed by 16981e27

Merge request reports