Patch coming.
Created attachment 20241 [details] patch
Comment on attachment 20241 [details] patch r=me. You could make this even better by putting the math (or eve into a separate function.
Committed revision 31481.