twbs/bootstrap — pull request #13589 by mrobinet (2014-05-13 15:09:12+00:00)
Title: Adjust for Scrollspy offset when calculating maxScroll.

There is a bug in Scrollspy where it will prematurely jump to the last navigation element when using an offset. The large the offset used, the more prominent the problem becomes.

Here is a JSFiddle that shows the issue:
http://jsfiddle.net/4gnGy/4/

The fix is to add the offset to the maxScroll. All of the offsets created during Scrollspy initialization will be the offset + each element's scrollTop value so maxScroll needs to account for the offset as well.