shoes/shoes4 — pull request #500 by PragTob (2013-12-13 17:15:35+00:00)
Title: Fix Leave/Hover, off by one error for element right/bottom and positioning (fixes #499)

This mainly addresses #499

Here are the main contributions of this PR:

- leave procs are now called before hover procs (e.g. for neighboring slots we first call the leave block for one slot before the hover block for the other slot is called (noting that the other block was entered) - more natural)
- off by one error fixed for absolute_right/bottom and element_right/bottom. E.g. right used to be calculated as `left + width` which is wrong. It's rather left + width -1 as the first pixel also counts. Let me give you an example: Say left is 20 and we have a width of 100 then the right must be 119, because you have to take pixel number 20 into account so 20..119 is 100 pixels width while 20..120 is 101. E.g.: `(20..119).size => 100`
- the positioning code now positions at the pixel next to the last pixel occupied by the element before instead of on the same (this caused slots and elements to always overlap by **one** pixel). E.g. before if the previous element had a right of 42 the next element would start at 42, now it starts at 43
- Also added specs for the `MouseMoveListener` - making life easier and bringing test coverage up!

Looking for feedback but want to merge it quickly as well (started out as a: okay I can fix that in 30 mins...) :-)

Also @jasonrclark : some changes to position related code in here, e.g. `max_bottom` of current_position is now called `start_next_line` because that's what it always really was (it's just max_bottom + 1 though).

PS: While making this PR I was super happy about all the refactorings we did during the summer. Adjusting how right works with the right logic duplicated for every element would have been hell. Finding where to add + 1 in the old positioning code would have been very hard. Also the positioning specs really helped (I often thought I had the solution when I didn't... THANKS SPECS!)