If element location is at the bottom and withing the last window height, then we have to set end location to the highest possible and valid scroll position.
This fixes the problem that animated scrolls are abruptly stopped because the location was higher than the latest possible scroll location.
If element location is at the bottom and withing the last window height, then we have to set end location to the highest possible and valid scroll position. This fixes the problem that animated scrolls are abruptly stopped because the location was higher than the latest possible scroll location.