improved calculation speed by requiring a call to update if sizes change. fixed scroll bug on android, see http://uihacker.blogspot.pt/2011/01/android-touchmove-event-bug.html